Functions, return and if / else


#1

I am not sure what is wrong, when pressed Save Submit Code it came out to be correct but nothing printed to my window, nothing.
Here is my code:

 // Define quarter here.
var quarter = function(number){




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

Not sure what is wrong.


#4

You are so close! All you have to do is put 24 in between the parentheses in your if statemwnt. So it should look like this:

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

instead of:

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


#5

There is more wrong than that, however. The if statement has been written inside the function body which is not what is intended.


#6

this is my code

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

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

and this is the error
Oops, try again. Hmm, it looks like your quarter function doesn't return -25 for -100


#7

The function body is empty, so not completely defined.

    return number / 4;