Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let animalList = [];
- for (var i = 0; i < animals.length; i++) {
- var currAnimal = animals[i];
- console.log("the animal is", currAnimal, "The list is", animalList);
- animalList.push(currAnimal);
- }
- animalList is undefined
- the animal is {id:1, animal:"cat"} the list is []
Add Comment
Please, Sign In to add comment