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() % 3 === 0 ) {
console.log("The statement is true");
} else {
console.log("The statement is false");
}

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


#2

you forgot to put a number inside the call function quarter() inisde your if condition


#3

you need to have:
return number/4


#4

I have that problem as well.

This is my code - still doesnt work though:

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

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

Come learn and talk with 255 Pythonistas in our friendly Slack chat. (for both beginners and professionals):
http://devchat.devolio.net/


#5

Hello guys,

this is the right code that will work for you !

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");
}