Principle
All things are objects. Suppose ' Mulder ' (Me) as an object. The properties of the MoD are name, gender, age, etc. Mulder's behavior is eating, walking, sleeping and so on. The interaction between Mulder and others is an object. Object corresponds to an entity in the world. Class, which is the classification of managed objects. If the MoD is a specific object. A man is a class. person is the interface.
How to Build
Singleton object: JSON
Common objects:
(function (w,m) { = function () { // constructor function Invitefriends () {}; // prototypes Invitefriends.prototype = { ' invitefriends ', ... } return New invitefriends (). init ();} ;}) (Window, window.) HB);
Inherited
Off Topic
Basic usage of objects: combination, inheritance.
Combination, where an object introduces another object. The two are interwoven together to accomplish a function.
notation
To inherit the parent class's construction method
Supertype.call (this, arguments);
Inherit the prototype chain of the parent class
var prototype = Object (suptype.prototype); = subtype; = prototype;
principle
, each object will have a prototype object that is pointed to by a hidden reference [[prototype]]. In the prototype object, [[prototype]] points to the parent object, and the layer is traced back to object.