Home > Article > Web Front-end > Javascript Object object study notes_basic knowledge
Constructor
new Object()
new Object(value)
Parameters
value
Optional parameter that declares the original value (i.e. number, Boolean value or string) to be converted into a Number object, Boolean object or String object. This object is not supported by JavaScript versions prior to 1.1 and ECMAScript Vl.
Return value
If no value parameter is passed to the constructor, it will return a newly created Object instance. If the original value parameter is specified, the constructor will create and return a wrapper object of the original value, that is, a Number object, a Boolean object, or a String object. When the Object() constructor is called as a function without using the new operator, it behaves the same as when using the new operator.
Properties
constructor
A reference to a JavaScript function that is the object’s constructor
Method
1.hasOwnProperty( )
Checks whether an object has a locally defined (non-inherited) property with a specific name.