July 2008
Beginner
356 pages
6h 8m
English
This Appendix lists the built-in constructor functions outlined in the ECMAScript standard, together with the properties and methods of the objects created by these constructors.
Object() is a constructor that creates objects, for example:
>>> var o = new Object();
This is the same as using the object literal:
>>> var o = {}; // recommendedYou can pass anything to the constructor and it will try to guess what it is and use a more appropriate constructor. For example, passing a string to new Object() will be the same as using the new String() constructor. This is not a recommended practise, but still possible.
>>> var o = new Object('something');
>>> o.constructorString()
>>> var o = new Object(123); >>> o.constructor ...
Read now
Unlock full access