8) Functions, return and if/else


#1

What's the mistake? Can't figure it out.

varQuarter = function(number)

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

Replace this line with your code.

`


#2

Example of function expression:

var x = function (a, b) {
   return a * b
};

So, review your function.


#3

Still it didn't work


#4

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

#5


#6

You have to have a space between var and quarter.


#7

var quarter = function (number) {...}

var is a keyword
quarter is a function name
number is an argument


#8

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