8# Syntax Error


#1

can you please help me with this, i don't see any problem, or i might just have misunderstood what i had to do?

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


#2

@splatter_nick

Here it says to define a quarter but your function returns the number divided by six! You also forgot to put semicolons after your variable so JavaScript recognize it as the end of an instruction and a beginning to another one.

Your if statement doesn't seem right. You put two pair of parentheses instead of one.


#3

i don't understand what you mean with two instead of one


#4

@splatter_nick

Remember an if statement syntax looks like this:

if (condition) {
   // Some codes runs here if condition is true
}

You put two set of parentheses here:


#5

something is still wrong, it still says Syntax Error

what else could be the case?


#6

@splatter_nick
You must call the function quarter putting in parameter a number that will make the statement true and print out the code between the brackets of the if statement. Remember you call a function like this:

functionName(optional parameters);

Codeacademy has already given you a start of how your code should look like:

if (quarter(/* Here, you must put a number */) % 3 === 0 ) {

The number that will be input will first be divided by four then tested whether the quarter of this number is evenly divisible by 3. If true, then print out the code in the curly brackets.


#7

it still says Syntax Error on this

// Define quarter here.
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");
}


#8

Hi this part remove the ; after the )

var quarter = function (number);  <== remove it

#9

@splatter_nick
Make sure also to add a semicolon after this:


#10

Thank you guys, you may not know, but this is big for me :smiley: