Why is my code not working?


#1

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


what is the problem in my code?
why isnt it working ?
// Define quarter here.
var quarter=function()
{ return 100/4};

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

error is :Oops, try again. Hmm, it looks like your quarter function doesn't return -25 for -100.


#2

your quarter function doesn't have a parameter, see instructions. You should divide the parameter by 4, not a fixed number


#3

Here, you forgot to use the number parameter.

also, use the number parameter to find a quarter.

Finally, don't forget to call a value on quarter, here, that would cause it to print 'The statement is true'


#4

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

if (quarter(100) % 3 === 0 ) {
console.log("The statement is true");
} else {
console.log("The statement is false");
}
error: Did you remember to call quarter() inside the if statement with a value that would cause it to print 'The statement is true'?


#5

this line:

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

a quarter of 100 is 25, 25 % 3 is one, not zero. The if condition has to be true, pick a number of which a quarter has a remainder of zero


#6

thank you for your fast ever reply!!!


#7

thank you!! for your faster response


#8