SyntaxError: Unexpected identifier / Functions, Returns, and if/else


I am getting a Syntax Error that I can't figure out that says "Unexpected Identifier"

// Define quarter here.
val quarter = function (number) 
  {  return number / 4; };

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


Did you mean to write var? This, val is the unexpected identifier indicated in the error message.


Oh my gosh... I was going over every semicolon and bracket and it was a
spelling error.... Thank you for catching it!


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