Did you remember to call quarter()


#1

this is my code. but Oops, try again. Did you remember to call quarter() inside the if statement with a value that would cause it to print 'The statement is true'?

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

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


Functions return and if/else, help
#2

The quarter() function takes one argument, and there is none given.


#3

What is the argument? I don't get it.


#4

The argument is the value you pass to the parameter of the function.

var quarter = function (number) {

};

number in the above is the parameter. Our function call should have a matching argument, and judging from the name of the variable and the function, it will be a number.

quarter(36)

will return 9, which is 36 / 4.


#5

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