#8 help


#1

var quarter=function(number){
console.log(number/4);
}
if (quarter(60) % 3 === 0 ) {
console.log("The statement is true");
} else {
console.log("The statement is false");
}
I have this and it says that there is an error what am I doing wrong


#2

Hi here

console.log(number/4);

you shouldnt print it but return it so try it like that

return number / 4;

#3

Change this to

return (number/4);

#4

I did the return function but it keeps saying
"Oops, try again. Did you remember to call quarter() inside the if statement with a value that would cause it to print 'The statement is true'?"
what is going on.


#5

Please post code.  


#6

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


#7

Hi You should put inside quarter() a number that divided by 3 will have as remain 0. So that it will print

 console.log("The statement is true")

#8

I'm still struggling with this. I do not understand what is wrong. Still receiving the error:
Syntax Error: expected, expression, got keyword 'else'

Here is my code:
// Define quarter here.
var quarter = function (number) {
return (number/4);
}
if (quarter(60) % 3 === 0); {
console.log("The statement is true");
}
else {
console.log("The statement is false");
}

Any help would be greatly appreciated. I want to get through this exercise once and for all.


#9

Hi here

if (quarter(60) % 3 === 0); <=== this one

You should remove the ; after your if condition


#10

It works! Thank you for help everyone. Finally, onto the next section.


#11

Thanks for the posts everyone, this has been very helpful.