Return and Call of Functions within if/then statements


#1


https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/1/3?curriculum_id=506324b3a7dffd00020bf661#


It keeps saying "unexpected identifier"...I can't figure out this part...
Call the function inside the if statement's condition (and put in a parameter value!) such that "The statement is true" is printed to the console.

Thanks for any help!


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


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


#2

Hi Eric,

Your error is for sure a bit tricky to spot, but why don't you give your code once over one last time? Are you sure you declared a variable?

frisby


#3

Hi!! Wow, I can't believe that it was a typo all along!!! Thank you so much! I can't tell you how long I sat trying to figure it out before posting :slight_smile: I've just been trying to learn coding for the first time today so I don't really know what I'm doing so I assumed it was the code that was wrong. Appreciate the help!!


#4

Hi Eric,

No problem! I had to look through your program a few times to figure it out too. Eventually, I compared yours to mine character by character until I found the discrepancy, hahaha. I'm glad to hear you tried to figure it out before posting; sometimes typos can be the trickiest errors :smile:

Welcome to the world of coding! I'm pretty new to it myself, but I hope you're having a good time.

frisby