O'Reilly logo

Object-Oriented JavaScript - Second Edition by Stoyan Stefanov, Kumar Chetan Sharma

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix C. Built-in Objects

This Appendix lists the built-in constructor functions outlined in the ECMAScript (ES) standard, together with the properties and methods of the objects created by these constructors. ES5-specific APIs are listed separately.

Object

Object() is a constructor that creates objects, for example:

> var o = new Object();

This is the same as using the object literal:

> var o = {}; // recommended

You 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 practice (it's better to be explicit than let guesses creep in), but still possible.

> var o ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required