8. Functions, return and if / else | Help


#1

Hey, so I can't seem to get this right and I have NO idea what I am doing wrong. Help!

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

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

Instructions-
1.)Define a function called quarter which has a parameter called number.

2.)This function returns a value equal to one quarter of the parameter. (i.e. number / 4;)

3.)Call the function inside the if statement's condition (and put in a parameter value!) such that "The statement is true" is printed to the console.


#2

I changed the number from quarter(3)

to quarter(12) and that worked fine for me.


#3

That seem to work! Thanks!


#4

Plz help. I am on the same one. 8. functions, return and if/else. Javascript

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

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


#5

nvm I figured it out


#6

If all else fails, just change the false and true statements around and hit save. :wink: