Jetty web server - O Object() (Constructor) ECMA 262 edition 3
O Object() (Constructor) ECMA 262 edition 3 section 10.1.5 ECMA 262 edition 3 section 15.2 O’Reilly JavaScript Definitive Guide page 44 Wrox Instant JavaScript page 28 Object() (Constructor) An Object object constructor. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 3.0 Internet Explorer 4.0 Netscape 3.0 Netscape Enterprise Server 2.0 Opera 3.0 Property/method value type: Object object -new Object -new Object() JavaScript syntax: -new Object(aValue) Argument list: aValue An initial value for the new object When Object is called as part of a new expression, it is a constructor that may create an object instance. There are limitations what is sensible for the newoperator to be able to do with the Object constructor. Since the Objectis considered to be the highest ancestor of all objects in the prototype inheritance chain, you cannot logically have more than one Object object. Passing other native objects to the ObjectConstructor implies a type casting from their native object type to the Object type. That’s not logical either. The main use of the Object Constructor then is to manufacturer object instantiations from non-object data types. The table summarizes the resulting values from using the Object() constructor with the new operator. No argument Creates a new empty object null Creates a new empty object undefined Creates a new empty object Boolean Create a new boolean object whose default value is the input value Number Create a new number object whose default value is the input value String Create a new string object whose default value is the input value Native object Return the native object itself Host object Host implementation dependant behavior. Objects are cloned if necessary but some may not be Value Result 1577