# 2. through the hard times

#1

hello! could you please writing the code in 2nd?

#2

Javascript has the so-called modulo / remainder-operator 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
16%8 You read it as sixteen modulo eight is zero, as sixteen divided by 8 has NO rest-value.
Now for the exercise 2/33:

``````var multiplesOfEight = [8,16,24,32,40,58];
|  |  |  |  |  |
multiplesOfEight[0]  |  |  |  |  |
multiplesOfEight[1]  |  |  |  |
multiplesOfEight[2]  |  |  |
multiplesOfEight[3]  |  |
multiplesOfEight[4]  |
multiplesOfEight[5]``````

multiplesOfEight[0] --> 8
multiplesOfEight[2] --> 24
multiplesOfEight[5] --> 58

multiplesOfEight[0]%8 --> 8%8 --> 0
multiplesOfEight[2]%8 --> 24%8 --> 0
multiplesOfEight[5]%8 --> 58%8 --> 2

== 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
javascript array site:developer.mozilla.org
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array

#3

Thank you for help @leonhard_wettengmx_n . I'll look over them :))