Data Structures: Objects
Learn to understand how objects can be helpful for multiple tasks and how they can access the properties using different notations.
We'll cover the following...
Introduction to objects
A JavaScript object is another variable that allows us to store multiple pieces of data. Like arrays, objects are capable of storing any valid JavaScript data type, including arrays and other objects. However, unlike arrays, data in objects are stored in object properties.
Let’s once again take the example of a classroom with students. We will make a single student an object with multiple properties:
Press + to interact
var student = {name: "Mary",age: 10}
An object is declared using curly braces ({}
...