8. Functions, return and if / else



Now, I am a 'noob' to JavaScript so this is maybe the reason why I am struggling, When I input this code it comes up with 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'? but I do not know where to call quater()!!! Please help!?!?

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

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


Your function takes an argument, do you give it one?
The way you'd have found this yourself is by picking apart the condition and printing out its components to see what happened and then look closer at the part that acted differently from what you expected


Well, I really do not know what to put in as a argument.


You'll have to ask yourself what you mean for your code to do. Without that you're completely aimless and no knowledge of programming can help you.


Got It! :grinning:

Found out that you have to replace the (quarter() with a random number to make the statement true!

Thanks for your help.


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