NEED HELP ON Functions, return and if / else


#1


Functions, return and if / else


I have no idea what is wrong with my code, someone please help.


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




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

quarter(9)


#2

the if condition:

if (quarter(9) % 3 === 0 )

should evaluate to true, it doesn't. 2.25 % 3 does not equal zero. Make the condition true


#3

Try the variable number as 36 or a number that when divided by 4 then divided by 3 is a whole number with no remainder. SO if X is the number then::
(x / 4 )/ 3 = whole number with no remainder


#4

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