Exercise 2 · Chapter: ArraysRequired+50 XP
Add to Array
Start with an empty array called pets.
Use push() to add these 3 animals to the array: "cat", "dog", and "fish".
Then print the length of the array, followed by each pet on its own line.
Expected output
3 cat dog fish
Need a hint?
3 available · costs 5 XP each
javascript
Output
Run your code to see the output here.