Alex
Alex

Reputation: 53

I am just starting in code academy. I am getting the error "SyntaxError: Unexpected token"

My code is :

// 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");
}

It returns "SyntaxError: Unexpected token"

Can someone point me to my error. Thanks

Upvotes: 0

Views: 35

Answers (3)

Sam5487
Sam5487

Reputation: 679

Remove the semi-colon here: var quarter = function(number);

Upvotes: 0

SergeiBednar
SergeiBednar

Reputation: 390

You have a spare semicolon in the first line of code

Upvotes: 0

Gavin
Gavin

Reputation: 4515

var quarter = function(number);

needs to be

var quarter = function(number)

The semicolon is the unexpected token.

Upvotes: 1

Related Questions