JavaScriptProgrammer'sReference

We refer to the built-in Object class with a capitalised name. When referring generically to objects of other classes, the word object is all lower case. Therefore we can have an Object object and a String object. Native objects are built-in, host objects are also built-in but created outside of the JavaScript core functionality. User defined objects are not covered here.

Here is a list of object classes with a note about what sort of object they are and when how they are managed:

Class

Category

Description

Array

Native

A collection of objects in a sequence

Boolean

Native

A logical value container

Date

Native

A date value container

Function

Native

A function code container

Global

Built-in

A container for global properties, methods, and functions

Image

Hosted

Web browser image wrapper

Math

Built-in

A container for math functions

Number

Native

A numeric value

Object

Native

A generic object

String

Native

A sequence of characters

Because you might refer to documents in many ways, possibly by means of object properties or as a property belonging to another window, it is not safe to assume that the document property belonging to the Global object the script is attached to is always the document object you are trying to access. Because of this, the object references in the syntax examples assume the object is being referred to via a variable called myDocument or myObject etc. For example, the value myDocument is shown being assigned as a variable from the many alternative sources from which you can obtain a document object reference.