Functions return and if/else, help


introduction to functions/8.

syntax error expected expression, got keyword "if"

// Define quarter here.
var quarter = function (number)

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


A function definition requires a code body { }. What is this function supposed to return? A number divided by 4 (as the name would infer)?

var quarter = function (number) {
    return number / 4;

The exercise specifies that we are to log The statement is true so that means the argument passed to quarter() will have to be a multiple of both 3 and 4. This is an LCM type of problem.


A post was split to a new topic: Did you remember to call quarter()