Skip to content

Challenge Build JavaScript Objects

SaintPeter edited this page · 1 revision
Clone this wiki locally

Build JavaScript Objects

Objects are similar to arrays, except that instead of using indexes to access and modify their data, you access the data in objects through what are called properties.

Here's a sample object:

var cat = {
 "name": "Whiskers",
 "legs": 4,
 "tails": 1,
 "enemies": ["Water", "Dogs"]
};

Objects are useful for storing data in a structured way, and can represents real world objects, like a cats.

Something went wrong with that request. Please try again.