1. Constructors (relative to classes in object-oriented programming languages)
2, object instance (it is the object constructed by the constructor, use to the keyword new)
3, this keyword (often refers to our object itself)
Let's look at an example:
var person = function person (living, age, gender) {
Below is the new object, which is being created (i.e. this = new object ();)
this.living = living;
This.age = age;
This.gender = gender;
This.getgender = function () {return this.gender;};
}
When the function was called with the New keyword ' This ' is returned instead of false
Instantiate a person object named Cody
var = new person (true, Cody, ' Male ');
Cody is a object and an instance of person ()
Console.log (typeof Cody); Logs Object
Console.log (Cody); Logs the internal properties and values of Cody
Console.log (Cody.constructor); Logs the person () function
JavaScript Series learning----Object Related concepts Understanding