8.Functions, return and if/ else What's wrong?!


#1


#2

actually the format is C++'s because i learnt c++ before.


#3

Yeah... that might be why. :smiley:

You wrote your quarter function incorrectly, for no semi colon after the function and before the corresponding bracket. :smiley:

Delete the semi colon after your quarter function and put the { in front of the function, which should work. :smiley:


#4

As well as what @ragezapper said, you probably need to remove the quotation marks around number in your function:

var quarter = function("number")

should be

var quarter = function(number)

#5

Hello,

  • delete in 3rd line ;
  • in 13th line, you wrote " quater " but must be " quarter "
    :smile:

#6

On line 6 you did not put a number in (quarter(). Here is my code on line 6.

if (quarter(24) % 3 === 0 ) {

It worked for me.