I am stuck in JS IF statement/return please help


#1

// Define quarter here.

var quarter = function (number);

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

can someone please help me... I tried a lot but my code does not work at all.


#2

Hi here
1 defined a function called quarter with one parameter.
2 this function should return that return number /4 so it should be like that

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

and then they aske you to call the function quarter inside a if statement and should print this ``` "The statement is true"``` you could do it like that .

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

}

#3

thank you so much ... i was trying to return it from the IF statement maybe that was the reason.
i learnt something new by declaring variables and parameters in block. thanks once again