Tell us what’s happening:
i need someone to explain to me the process of
+=or-= and to help my code pass the test
Your code so far
// Example
var ourArray = [];
for (var i = 0; i < 10; i += 2) {
ourArray.push(i);
}
// Setup
var myArray = [];
for (var i=0; i < 9; i +=1) {
myArray.push(i);
}
// Only change code below this line.
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:65.0) Gecko/20100101 Firefox/65.0.
odd numbers are those that are not divisible by 2 at least their division by 2 does not give a whole number and the operation + = allows to add the number to the right of the operator to the current value of the variable of left which means that if you have var A = 5; A += 2 you will add 2 to the actual value of A so a will be worth 7 and if A += 3 you will add 3 to the actual value of A so A will be worth 8 and so on.
So if you want to iterate through odd number from 1 to 9 you have to init you loop var to 1 and iterate untill 9 which means x <= 9 or x < 10 and for the incrementation i let you guess