Suck on lesson 3


#1

So I'm just geting "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'?"

My code
`
// Define quarter here.
function quarter(number){
return number/4;
}

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

`


#2

@inaneg,
In your IF condition you are using

quarter(90) % 3 === 0

you are using Javascripts remainder operator
in normal life also called the modulo operator
and if used it will return the rest-value.

9%3 You read it as nine modulo three is zero, as 9 divided by 3 has NO rest-value.
22%6 You read 22 modulo six is 4, as 22 divided by 6 will leave you with rest-value 4
10%5 You read 10 nodulo five is zero, as 10 divided by 5 will have NO rest-value

So you will have to figure out a number Value
which you will have to use as an argument in your quarter function

=========================================================

google search
== the Book ==
javascript remainder operator site:developer.mozilla.org
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators

== discussions / opinions ==
javascript remainder operator site:stackoverflow.com
http://stackoverflow.com/questions/4467539/javascript-modulo-not-behaving
http://stackoverflow.com/questions/336859/var-functionname-function-vs-function-functionname?rq=1

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators
== guidance ==
www.crockford.com
http://javascript.crockford.com/survey.html
http://javascript.crockford.com/code.html <<< Javascript coding conventions


#3

Aha thanks @leonhard.wettengmx.n now I get it!
Is there anyway I can mark this question as answered?