Javascript - Creating Objects (key-value pairs)
Code Life
By Pierre Marsaa
Describing One Codémon
An array is great for a list of similar things. But how do you describe one Codémon, with its name, its type and its level? Separate variables get messy fast:
↗️
Loading editor...
↶
↷
An object groups these values under one variable, each with a label called a key. You read a value with a dot followed by its key:
↗️
Loading editor...
↶
↷
Verify