8.Functions, return and if/else


#1


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


This code refuses to work. 

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




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

Please help if possible. Thank you! :sunglasses:


#2

on this line:

((number) / 4);

the return keyword is missing
on this line:

var quarter = function quarter(number)

you have quarter twice, think about which one you need to remove.

the if condition should evaluate to true, it doesn't


#3

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

this function doesn't return anything .this function should return somthing.
that's why .........

if (quarter(27) % 3 === 0 ) //wrong

because here quarter(27) == undefined


#5

3 posts were split to a new topic: 8. What is wrong with this code?