Functions, return and if / else Help..Confused


#1


Functions, return and if / else

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'?

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

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


#2

HI your function quarter take an argument so when you call it in the if statement you should put a number inside it

if (quarter() % 3 === 0 ) {
..

#3

I just realize I did not need to call the function after the else statement. I put 12 to call the function quarter in the if statement and now I got that statement to print true.

Thank you wizmarco