JavaScript Built-In Objects


Objects have properties. Properties can have values. The values of these properties can be altered by methods. Methods act upon objects to alter property values and communicate (interface) with other objects.

Creating new objects

name = new String ("This is a string");
names = new Array ("Jim", "Joe", "Laura");

Object properties and values

Methods



The with keyword

The with keyword specifies an object. It is followed by a block of statements which apply specifically to the object to which the with keyword points.

with (name)
{
	document.write (length);
}

The Math object

The Math object contains many mathematical functions such as rounding, truncating, etc.

Dates

newDate = new Date (document.lastModified);

Getting & setting date values