8/13


#1

I have this as my code and it says function not defined
var quarter = funtion(number)
{
number/4;
}
if (quarter(12) % 3 === 0 ) {
console.log("The statement is true");
} else {
console.log("The statement is false");
}


#2

You have a spelling mistake in the first line. Double check this :relaxed:


#3

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

does it.


#4

thanks i noticed after i had posted the code


#5

glad you posted this as i was stuck for a while...so easy to miss really minor errors and the feedback in the black console window doesn't tell you whereabouts the syntax error is

for instance:
Oops, try again. There was a problem with your syntax.
SyntaxError: missing ) after argument list

I was looking in the wrong place for ages haha


#6

Pleased this has been posted. I had the code right but took "quarter" literally so assumed it could only be
if (quarter(1, 2, 3 or 4) % 3 === 0) {

Obviously all 4 produced "The statement is false". The solution made sense once I saw it but I wouldn't have thought of trying quarter 12.

Thanks