GoConqr has a new look! Let us know what you think.

Module 2 of 14 · Media

Object Literal

Kostas Diakogiannis

Object Literal

Creating JS Objects

Objects are one of the 7 standard JS Data types and are heavily used to store multiple variables together. Objects are comprised from a set of key value pairs (syntax-wise like CSS). The key acts like a placeholder and the value is as usually the value this variable contains.

In the example above we have created an object to store information in one place, where otherwise we would have needed multiple variables. This object now holds information about a person. The pieces of information are the keys (or object's properties) and the values can be any JS data type (even other objects as we will see later on).

In order to access a specific piece of info now we need to console.log(jake.firstName) etc.

 

 

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?