What does this mean?


#1

On Functions, return and if / else, the answer has it printing out the numbers -25 to 25 for some reason?
What does this mean?
The code was:
var quarter = function (number) {
var value = number/4;
console.log(value)
return value
};

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


#2

Really strange behavior :confused:
Try remove console.log(value). Also you can wright function without var value:

...
return number/4;
...

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.