code-201-reading-notes

read06

Object Literals

What is an object?

Objects group together a set of variables and functions to create a model of a something you would recognize from the real world. In an object, variables and functions take on new names.

Creating an Object: Literal Notation

it is the easiest and most popular way to creat objects objects as you can see her, dog1 is the object. Name, colors, and age are properties, and “max”, “brown” and “5” are values. if we used a function to return one of these values, we call this function is that case as a method.

The Document Object Model

The Document Object Model (DOM) specifies how browsers should create a model of an HTML page and how JavaScript can access and update the contents of a web page while it is in the browser window. The DOM is neither part of HTML, nor part of JavaScript; it is a separate set of rules. It is implemented by all major browser makers, and covers two primary areas: