Appendix DJavaScript Quick Reference

This appendix is a quick reference for the JavaScript language. It includes the built-in objects and the objects in the basic object hierarchy, JavaScript statements, and built-in functions.

Built-in Objects

The following objects are built in to JavaScript. Some can be used to create objects of your own; others can only be used as they are. Each is detailed in the following sections.

Array

You can create a new array object to define an array—a numbered list of variables. (Unlike other variables, arrays must be declared.) Use the new keyword to define an array, as in this example:

students = new Array(30)

Items in the array are indexed beginning with 0. Refer to items in the array with ...

Get Sams Teach Yourself JavaScript in 24 Hours 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.