Function, return and if/else. Help!


#1

Hi
I've been looking at this for a while and... I'm reeally having trouble to find the mistake here. What am I doing wrong?

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

if (quarter(12) % 3 === 0 ) {
console.log("A declaração é verdadeira");
} else {
console.log("A declaração é falsa");
}


#2

If you mean that your quarter function doesn't return anything, that's because semicolon ends the current statement. Your block-statement after the function is not part of the function.


#3

Ahh, now I get it! That's exactly it. Thanks for the help, it's finally working now! :slightly_smiling: