Learn JavaScript

Object with multiple properties

An object can have multiple properties, separated by commas:

In the example given below, we have an object car, with two properties. The first property has the key model and the value 2011, while the second property has the key fuelType and the value diesel.

Let’s create another object person. It stores the properties given in the table below:

Key Value
fullName Adam Smith
age 37
isAdmin true