What Is wrong with my code


Introduction to Functions in JS
Functions, return and if / else

It's been a while since I coded in Js so my code became stubby and unorganized, I needed to get more exercise so I came here to codecademy, but I stumbled across this error, I didn't know what to do.

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() % 15 === 0 ) {
  console.log("The statement is true");
} else {
  console.log("The statement is false");

What could be the issue? I believe I suck at modulo so I don't know what number to put in this code :smiley:

Thanks in advance


if (quarter() % 15 === 0 )

You called the function but forgot to put argument: quarter(10)
Function quarter has parameter number, so when you calling the function count of parameters should be equal to count of arguments.


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