Why does the computer log "-25"?


#1


8. Functions, return and if / else


It logs:
___3
___the statement is false
___-25

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


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


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


#2

the error message:

Hmm, it looks like your quarter function doesn't return -25 for -100.

there is a crucial word in this error message: return

your quarter doesn't return anything at all, it only logs to the console


#3

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