Knowledge Maxxing
← Back to topic library
Dev MaxxingBeginnerJavaScript60 sec

JavaScript object

A JavaScript object is a collection of key-value pairs, letting related data and behavior be grouped together under one variable.

Prerequisite: JavaScript variable

What matters

Objects are the primary way JavaScript structures complex data, from a single user's profile to configuration settings, rather than tracking many separate loose variables.

Example

A user object might be '{ name: "Ada", age: 30 }', letting both properties be accessed together as 'user.name' and 'user.age'.

Common misconception

A JavaScript object is not the same as an array; arrays are ordered lists, while plain objects are unordered collections of named properties.

Recall question

What is a JavaScript object used to group together?

Keywords and related concepts

JavaScript objectkey-value pairspropertiesarray

Related topics

Array
Dev MaxxingBeginner
JavaScript variable
Dev MaxxingBeginner