So the thing is fairly simple to do and my code does what is supposed to but I’m getting the massage that I should be using For Loop for this. But I am. I am blind to see what’s wrong with my code.
EDIT: I am also getting the same message in the next lesson which is pretty similar.
Your code so far
// Setup
var myArray = [];
// Only change code below this line
for (var a =1; a < 6; a++) {
myArray.push(a);
}
console.log(myArray);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0.
Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.
So when I copy this and modify it to fit the lesson it works with every one. If I copy only bottom part it still doesn’t work. If I write exactly what you wrote it doesn’t work either.
var myArray = [];
// I closed the space between for () to for()
for(var i=1; i < 6; i++){
// using "i" is just a convention
// not technically right or wrong
myArray.push(i);
}