Functions return and if/else, help


#1


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


#2

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.


#3

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


#4