Alex Alex - 1 year ago 104
Javascript Question

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

Answer Source

var quarter = function(number);

needs to be

var quarter = function(number)

The semicolon is the unexpected token.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download