Lesson 8.Functions


#1



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


This is the error message SyntaxError: expected expression, got keyword 'else'

my code

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




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


#2

shouldnt have a semicolon at the end of if statement @feephill :wink:.


#3

Okay, I fixed that, now it's giving me this error.
Error: 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'?


#4

thats because you have to pass a argument... like :

 quarter(12)

not just empty paranthesis...


#5

Thank you for your help