Closed annaragnii closed 3 years ago
I wrote:
var pets = ['cat', 'dog', 'rat']
for (let i = 0; i < pets.lenght; i++) { pets[i] = pets + 's' } console.log(pets)
but Javascripting said to me:
─────────────────────────────────────────────────────────────────────────────
Solution ===================
[ 'cats', 'dogs', 'rats' ]
Your Attempt ===================
[ 'cat', 'dog', 'rat' ]
Difference ===================
Can you check this line again pets[i] = pets + 's'
pets[i] = pets + 's'
Try this:
for (let i = 0; i < pets.length; i++) { pets[i] = pets[i] + 's' } console.log(pets)
I wrote:
var pets = ['cat', 'dog', 'rat']
for (let i = 0; i < pets.lenght; i++) { pets[i] = pets + 's' } console.log(pets)
but Javascripting said to me:
O-oh, something isn't working.
But don't panic!
─────────────────────────────────────────────────────────────────────────────
Check your solution:
Solution ===================
[ 'cats', 'dogs', 'rats' ]
Your Attempt ===================
[ 'cat', 'dog', 'rat' ]
Difference ===================
[ 'cats', 'dogs', 'rats' ]