Here’s how we define an object:
const car = {}
This is the object literal syntax, which is one of the nicest things in JavaScript.
You can also use the new Object
syntax:
const car = new Object()
or also Object.create()
:
const car = Object.create({})
Those are all equivalent. The end result will be the same thing.