If and Else Really bad code - HELP!


#1

Hey guys! Really think I have messed up the If and Else statement- sorry but it's my first time doing this :frowning: would really appreciate any help!

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

var newNumber = quarter (17);

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


#2
var newNumber = quarter (17);

17/4 = 4.25 and quarter (newNumber) means again dividing this by 4 -> 4.25/4 =1.0625 now this modulo 3 has a remainder of 1.0625 which is not 0. Just pick a number that is divisible by 4 and after doing this also divisible by 3.

Btw also you're missing a ( here after if:

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

#3

var quarter = function (number) { <--------------no semi colon after (number)

if (quarter (newNumber) % 3 === 0) { <------------ parenthesis after if