Not sure what to do!


SyntaxError: Unexpected keyword 'if'. Expected an opening '{' at the start of a function body.

// Define quarter here.
var quarter = function(number)

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


The correct syntax for a function is as follows:

var myFunction = function(foo) {
   // stuff happens

Don't forget the curly brackets!

I should also add that currently your quarter() function doesn't do anything (except take the argument number), so when you call it below, it won't return any result.


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