Please help me


#1

Heres my code, it says that SyntaxError: missing before statement.
here is my code:
var quarter() = function(number){
return number / 4;
};

if ( quarter(number) % 3 === 0 ) {
console.log("The statement is true");
} else {
console.log("The statement is false");
}


#2

Well you need to replace number with an acutal number. This number e.g. will then be assigned to the parameter called number then returned divided by 4. And then the result should be without rest be divisable by 3.


#3

it still says there is a problem with my syntax: missing before statement. here is my code:
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");
}


#4

get rid of the () after quarter here. Here you just assign your function to the variable quarter, calling it by appending the () is done below here:


#5

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");
}; The semicolon is at the end.


#6

No there is acutally no semicolon needed. In this case it is not really harmful as it is one the very end of the condition but in genereal conditions don't need semicolons and they might even be dangerous when used at the wrong places:


#7

can someone please give me the answer of intro to functions js lesson 5

plz help :tired_face: :sob:


#8

var quarter=function(number)
return number/4;

if (quarter(24) % 3 === 0 ) {
console.log("The statement is true");
} else {
console.log("The statement is false");
}

It does not work "syntax error"???? Which one ??