Javascript - Arrays of Objects
Code Life
By Pierre Marsaa
The Shape of Real Data
Imagine storing your battle team when each Codémon has its own name, type, and level. In real programs, almost every collection of data takes this shape: an array holding the list, and an object describing each item:
↗️
Loading editor...
↶
↷
To read any piece of data, follow the path from left to right: the square brackets [0] select which element in the array, and the dot .name selects which property of that object.
Verify