1. Constructor function
2. Five prototype principles
(1). All reference types (arrays, objects, functions) have object attributes that can be extended freely (except null)
(2). All reference types (arrays, objects, functions), all have
A _proto_ property, the property value is a normal object (implicit prototype)
(3). All functions have a prototype attribute, and the property value is also an ordinary object
(4). All reference types (array, object, function), _proto_ property value to the value of the prototype property of the constructor
(5). When trying to get a property of an object, if the object itself does not have this property, it will go to its _proto_ (that is, its constructor's prototype) to find
In this case, the F object does not alertname this property and then goes to his _prototype_ to look for the property in the prototype of his constructor.
3. Prototype chain
1. instanceof is used to determine how a reference type belongs to that constructor
The logic of the F instanceof Foo is:
F of the _proto_ layer up, can correspond to Foo.prototype
And try to Judge F instanceof Object.
2. About the process of describing a new object
Create a new object, this points to the new object, executes the code, that is, assigns a value to this, returns this
3 Prototype chain example (imitate Jqurey source code)