The JavaScript Object Notation

In this lesson, we cover the JavaScript object notation. Let's begin!

In several code snippets, you already saw an interesting notation when displaying an object value. For example, take a look at this short code:

Press + to interact
var car = new Object();
car.manufacturer = "BMW";
car.type = "X5";
console.log(car);

When you run this code snippet, Chrome displays this console output:

Object {manufacturer: "BMW", type: "X5"}

The notation you find between the braces, including the braces themselves, are a perfect description of the object. You can understand that this object contains two properties, manufacturer and type, and you also know the values of these properties are “BMW” and “X5”. This kind of notation is not an arbitrary one used by Chrome.

It is called JavaScript Object Notation (JSON). ...

Access this course and 1400+ top-rated courses and projects.