Yeah, of course: I´m trying to solve the famous FizzBuzz problem, by creating a new array in which to push values to. My idea was to loop all numbers up to 100 (should be 101, but whatever for now), and then add the conditionals (“If i%3===0, etc”). But I can´t seem to get the initial for loop working, lol.
I checked the syntax, but I can´t seem to find anything wrong with it. Isn´t it a variable that will iterate, the conditions in which to iterate and the conditions that will happen after an iteration?
It’s okay…all of us start somewhere. Even veteran developers get stuck on simple issues. That’s why coding teams have analysts and testers review their code.
The answer is in the first line of the link that @ArielLeslie shared. How many optional expressions?
You are successfully assigning the value returned by test.push(i) (which as you say is the length of the array) to test. That means that test is now a number instead of an array.