Functions, return and if / else


#1

I don't know what's wrong with my code here:

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

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

please help asap, thanks!


#2
if (quarter(15) % 3 === 0 ) {

15/4 = 3+3/4 
3.75%3 = 0.75
0.75 != 0

So better use a number that is divisible by both 3 and 4 like e.g. 12.


#3

oh didn't know it had to be dividable by both, thanks!