1. JS oriented (based on) object programming- class (Prototype object) and object (Instance object)
2. JS oriented (based on) object programming- construction method and this
1.1 Preliminary Master JS class (Prototype object) and object
1.2 What are member variables and member methods
1.3 Mastering the use of construction methods
JS is a pair-oriented dynamic scripting language, is a scripting language based on object and event-driven (EventDriven) and has security performance, he has various characteristics of object-oriented language, such as encapsulation (private, public two), Inheritance (Object impersonation method implementation), polymorphism , etc. for most people, JS as a functional language, only used as some simple front-end data input validation and implementation of some simple page effect, in many excellent Ajax framework, Eg:extjs, JQuery JS Object-oriented features are used extensively.
Case 1: Zhang Lao Tai has two cats small white, white, 3 years old, Floret, suit, 10 years old, enter the cat's name Output cat age suit, the wrong display does not have this cat.
1, the class is abstract, represents a class of things, such as people, animal objects seem specific
2, actual, representing a specific thing
3, the class is the template of the object instance, the object instance is an individual of the class
Special Note: JS in everything is the object
Custom Methods for classes
1. The constructor constructor creates the class before creating the object instance
Function class name/prototype () {}
var object name =new class
Object-Oriented Programming