ReferenceError shows up on console and yet it lets me move on to next lesson


// Define quarter here.
var quarter = function (number) {
var val = number / 4

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

When this code is typed in, "ReferenceError: number is not defined" shows in console, and yet, it lets me go on to the next lesson. Please let me know what I'm doing wrong (eg what I should take out, should add, etc). I'm pretty lost and could use some help.

Replace this line with your code.


In your quarter function the body should contain a return statement not a variable declaration,

no need to store it in a variable,

return number / 4

Also, Remove this line,

And put an integer in between the parentheses of the function call in your if statement,

any integer,

if ( quarter(10) //any you would like


Wow, I just received the notification for your comment. I went back and fixed my (disasterous) code. Thank you so much!


You're welcome. :smile:


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