Functions, return


#1

The code does not work. I have tried all variations and it simple does not work. The error message I get is
Oops, try again. Did you remember to call quarter() inside the if statement with a value that would cause it to print 'The statement is true'?

Here is my code:
// Define quarter here.
var quarter = function(number) {
var val = (number);
return number / 4;
};

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

else
{
console.log("The statement is false");
}


#2

They want this Statement "The statement is true" to be printed but your parameter 18 given to quarter will make it print "The statement is false" because 18/4 --> 4 and 4%3 --> 1 not 0

try something like this

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

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

else 
{
    console.log("The statement is false");
}

#3

thank you for the reply. I have tryed 12 and it worked. I was not sure why, but now you have explained it to me. Also it was hard to understand what is wrong because the system gave an error message that I did not call the function in my if statement.