The JavaScript Object
global object creates an object wrapper for any given value:
var obj = new Object([value])
If the value is null
or undefined
, the Object
constructor creates an empty object. Otherwise, it will create an object of a type that corresponds to the given value:
var number_object = new Object(123); // equivalent to number_object = new Number(123);
var array_object = new Object([1, 2, 3]); // equivalent to array_object = new Array([1, 2, 3]);
constructor
Object
objectprototype
hasOwnProperty(property)
true
if the object has the specified property, or false
otherwiseisPrototypeOf(object)
true
if the object is in the specified object's prototype chain, or false
otherwisepropertyIsEnumerable(property)
for...in
loop)toLocaleString()
Object
objecttoString()
Object
objectvalueOf()
If you see a typo, want to make a suggestion or have anything in particular you'd like to know more about, please drop us an e-mail at hello at diveintojavascript dot com.
Copyright © 2010-2013 Dive Into JavaScript