Built-In Object Properties
The built-in objects are those that are pre-defined for JavaScript, but have nothing specifically to do with the Web or web browsers. The built-in objects are as follows:
- string objects (created automatically when you create a variable with a string value)
- the math object (for performing various mathematical calculations)
- the date object (for obtaining information about the current date)
- the array object (used to create arrays of data)
- the function object (used to create functions)
The string, array, and function objects will be discussed elsewhere in this guide; the math object will be of specialized interest primarily to mathematicians. Web developers in general will find the date object of more interest, but primarily for converting dates from one format into another. Below you will see the results of the simple script:
var now = new Date()
document.write('The current date and time is: ' + now)
|