The relationship between the front end of the constructor, prototype, an object instance

             

          Constructors: constructors, whether or not the constructor, and there is no substantial difference between the two; constructor function can be used as an ordinary, normal function can also be used as a constructor;首字母大小写仅仅是为了在开发中能易于区分他们。

          As long as invoked by the new operator, that is used as a constructor, this time an example of this new point

          If not invoked by the new operator, that is used as a normal function; In this case, the non-strict model this point window

         Prototype: the equivalent of a mold for the production of the object instance. js in object-oriented way, that is to say, js is the prototype-based object-oriented.

         js instance of an object: that object

Guess you like

Origin www.cnblogs.com/shenchanglu/p/11242025.html