DEV Community

Discussion on: Array Methods That .pop()

Collapse
 
zedentox profile image
Florian Lefèvre • Edited

Hi 🤚
Thanks for your post.
I think your example of shopping list is wrong. You can’t do associative arrays like this in javascript, you have to use object notation.

myShoppingList can be declared like this :

let myShoppingList = { juice: 2, cheese: 4}
Collapse
 
britnorcodes profile image
Em 💫

You're right! Thank you, Sorry I had gotten myself confused too! Have updated the blog 😄

Some comments have been hidden by the post's author - find out more