Functions, return and if / else


#1


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


Really Dumb question***

Why don't I need to call out the function anymore. I already know you're supposed to just put a value in the parenthesis, but why can't I call the function this way?


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




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


#2

HI this line

if (quarter() % 3 === 0 )

instead of quarter() you should put quarter(12) (the one you put at the end of your code)


#3

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