Object()

JavaScript 1.1+, JScript1.0+ Nav3+, NES2+, IE3+, Opera3+ Syntax

var variable = new Object(string)

Description

The Object() object is a primitive data type from which all JavaScript objects are derived. Table 6.30 shows the different properties of the Object() object.

Table 6.30. Properties of the Object() Object
Property Description
constructor Function that creates an object
eval() Evaluates a string of JavaScript code for the specified object
prototype Prototypes new properties for the specific object
toSource() Returns a string representation for the object
toString() Converts the object to its string representation
unwatch Removes a watchpoint for the object
valueOf Returns the value of the specific object
watch Adds a watchpoint ...

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