Functions, return and if / else


#1

I've been stock here in a really long time! Please help me!!!

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

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

It's keeps saying "Oops, try again. Hmm, it looks like your quarter function doesn't return -25 for -100.".

Thanks :wink:


#2

You forgot the "return" in the function.


#3

Thank you very much! It helped! :wink:


#4

You're welcome :grin:


#5

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

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

Took me 30 minutes to get the right statement to print.