Please help am stuck cannot move forward


#1

Hi,
I am currently using doing the Javascript course and I am very stuck and cannot move forward.

var quarter=function(number)
{console.log( number /4);
;}
if (quarter(8) % 3 === 0 ); {
console.log("The statement is true");
}
else {
console.log("The statement is false");
}
quarter(48)

This is the code I am using and the syntax error, it says that it is expecting an identifier and instead saw 'else'

Please help I am unsure what I did wrong!

Kim


#2

this line:

;}

the semi-colon and closing curly bracket are in the wrong order

your quarter function should return number divided by 4, not log it to the console

if (quarter(8) % 3 === 0 ); // unnecessary semi-colon

see comment

after 8 is being divided by 4, its no longer divisible by 3. Pick a number which is divisible by 3 after being divided by 4


#3

Thankyou!
I knew I was missing a return in there somewhere!
thanks for explaining it to me there is a lot to take in!
:smile_cat:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.