Home  >  Article  >  Web Front-end  >  javascript newThe essence of an object_js object-oriented

javascript newThe essence of an object_js object-oriented

WBOY
WBOYOriginal
2016-05-16 18:36:59932browse

I used to know these things, but I couldn't explain them, and I didn't delve into them. When I was reading "Understanding JavaScript" today, I suddenly opened my eyes when I saw the author's description.

The excerpt is as follows, the author said it very clearly:


The process of creating an object in the form of var anObject = new aFunction() can actually be divided into three steps:

The first step is to create a new object;
The second step is to set the object’s built-in prototype object to the prototype object referenced by the constructor prototype;
The third step is to call the object as this parameter Constructor to complete initialization work such as member setting.

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