Home  >  Article  >  Web Front-end  >  Javascript Object object study notes_basic knowledge

Javascript Object object study notes_basic knowledge

WBOY
WBOYOriginal
2016-05-16 16:26:10994browse

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.

Copy code The code is as follows:





This is another way
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Instructions for using the fs.exists method in node.js_node.jsNext article:Instructions for using the fs.exists method in node.js_node.js

Related articles

See more