Bracket notation with objects

How I’m I supposed to use bracket notation when the app won’t let me insert a bracket.

Hey there, add a new line after the object and use bracket notation there, like this:

let animal = {
    name: 'Pooch',
    species: 'Dog'
}
animal['age'] = 12

Hope this helps!
Ben

1 Like

Thank you. I got it though I don’t understand why I have to leave a new line.

We’ll be updating this puzzle in our next release, as a lot of users are getting stuck here.

That new line is part of our UI, and indicates that new properties can be added to the object. You’ll see the same thing with arrays and function parameters.

In all other lessons it’s generally helpful, but in this one it’s just causing confusion.

2 Likes

im stuck here this even tho I followed the method