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


#1


https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/1/3?curriculum_id=506324b3a7dffd00020bf661


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


#2

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


#3

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


#4

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