Key Built-in Object Methods

This section examines built-in object methods in some of the key objects in JavaScript. The three selected objects, window, string, and date, contain some of the most heavily used methods. As you might recall from the discussion of functions in Chapter 6, “Building and Calling Functions,” a method is essentially a function attached to an object or property of an object. In looking at the basic methods of the following objects, you should be able to cope with the bulk of methods used regularly in JavaScript.

The Window Methods

At the time of this writing, JavaScript window object has 18 cross-browser methods. Some of the methods, such as alert() and prompt(), have been used in illustrations extensively, and I will ...

Get JavaScript Design 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.