I use this:
for (i =1; i<10; i+=) {
myArray.push(i);
}
and I get an error that won’t allow my code to run
) is an “unexpected token”, why?
pasting this works:
for (var i = 1; i < 10; i += 2) {
myArray.push(i);
}
I use this:
for (i =1; i<10; i+=) {
myArray.push(i);
}
and I get an error that won’t allow my code to run
) is an “unexpected token”, why?
pasting this works:
for (var i = 1; i < 10; i += 2) {
myArray.push(i);
}
nevermind, I forgot the 2 and the var declaration