Chapter 5

Working with Objects

In This Chapter

arrow Specifying the features that define an object in JavaScript

arrow Working with objects

arrow Using object literals

arrow Making objects easier to use by naming them correctly

At one time, programming was entirely about writing procedures. You wrote a procedure to perform a task in a way that the computer could understand. Even if you used a higher level programming language, the process was the same — writing a procedure telling the computer to do something in terms it could understand.

As computer science progressed, it was found that people could relate better to coding scenarios that model the real world rather than the abstract world of the computer. Object Oriented Programming (OOP) is a technique whereby the developer creates a model of a real-world entity and then manipulates that entity with code. The underlying infrastructure translates the model into terms that the computer can understand. Objects are simply models of items you interact with in the real world in some way.

Given that objects are models of real-world entities, you need some method ...

Get HTML5 Programming with JavaScript For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.