Sample Video Frame

Created by Zed A. Shaw Updated 2024-02-17 04:54:36
 

19: Data Objects

JavaScript contains the interesting design decision to confuse the word "object" with two different uses. In one way an "object" is a container for data that is key=value style. You might find this form of data in a database table, a spreadsheet, or even if you look at your Contacts on your phone. The other use for "object" is in "object-oriented programming (OOP)", which is a much more complicated topic that we'll cover later in the book. In OOP you are using a combination of objects, classes, and functions to constrain your programming style so that your code can work better with other people's code.

In this exercise we'll focus on objects as a data type (or container), and I'll call them "data objects" to differentiate them from "objects" in object-oriented programming. There really is no difference between a "data object" and an "OOP object". They are the exact same thing but used in different ways. Using an object to store key=value data is the first simplest usage of an object. Then when you learn OOP you'll learn how to add to the "data object" concept for object-oriented programming.

Previous Lesson Next Lesson

Register for Learn JavaScript the Hard Way

Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.