Discover what definition of prototype, include the articles, news, trends, analysis and practical advice about what definition of prototype on alibabacloud.com
Prototype originated from French. The software standards are translated as "prototype", which represents the initial form of things and also contains the meaning of models and templates. The prototype concept in JavaScript exactly reflects the
Used JavaScript students are sure to prototype thunderclap piercing, but this is what it is a beginner mixed, only know that the function will have a prototype attribute, you can add a function for instance access, the other is not clear, recently
View plaincopy to clipboardprint? /*Each object instance has a prototype property member used to point to its instanceof object (temporarily called parent object)We call this layer-by-layer relationship pointing to the parent prototype [prototype
The concept of prototype in JavaScript aptly reflects the meaning of the word, and we cannot interpret it as a prototype concept of C + +.
All of the function-type objects of JavaScript have a prototype attribute. The prototype property itself is an
The prototype concept in JavaScript exactly reflects the content of the word. We cannot understand it as a pre-declared concept of prototype in C ++.All function objects in JavaScript have a prototype attribute. This prototype attribute is an object
I. Function creation process
Before learning about the prototype chain, let's take a look at what a function does during creation. Let's take an example of an empty function:
1 function (){};
When we declare such an empty function in the Code, the
ECMAScript has two development modes: 1. Functional (procedural); 2. object-oriented (OOP);
Create an Object1. Common objects of Creation
Create an object, and then give the object new properties and methods;
var box = new Object ();
I read "talking about JS object-oriented programming" a few days ago. At that time, I asked haoshen to findArticleIn some cases, it may be misleading (or different from ECMA). Later I flipped through ECMA and finally found the "standard ......This
I. Function creation processBefore learning about the prototype chain, let's take a look at what a function does during creation. Let's take an example of an empty function:Function (){};When we declare such an empty function in the code, the
This article Reprinted from: http://blog.sina.com.cn/s/blog_7045cb9e0100rtoh.html
Function: Prototype
Each constructor has a prototype attribute (prototype, which is not translated in the following example and is used in the original document ).
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.