Guest User

Untitled

a guest
Jan 17th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. let animalList = [];
  2. for (var i = 0; i < animals.length; i++) {
  3. var currAnimal = animals[i];
  4. console.log("the animal is", currAnimal, "The list is", animalList);
  5. animalList.push(currAnimal);
  6. }
  7.  
  8. animalList is undefined
  9.  
  10. the animal is {id:1, animal:"cat"} the list is []
Add Comment
Please, Sign In to add comment