Having problems with Javascript exercise syntax


Javascript Exercise

Syntax error.

// Define quarter here.
var quarter(number){
    return number/4;

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


Invalid code that is not called for. It can be removed.

number is not defined, so will throw an error (once the above line is removed). Use a number literal, like 12 or any multiple of it.


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