js object-oriented programming
1. Object-oriented programming 1. Process-oriented and object-oriented 1) Process-oriented: Focus on the process steps of how to solve a problem. The programming feature is to realize each step of the process step by function. There is no class and Object concept. 2) Object-oriented: Focus on which object solves the problem. The programming feature is that a class appears, the object is obtained from the class, and the object solves the specific problem. For the caller, process-oriented requires the caller to implement various functions by himself. Object-oriented, only requires the caller to understand the function of the specific method in the object, and does not need to understand the implementation details in the method. 2. Three Object-Oriented Features Three Object-Oriented Features Large feature inheritance, encapsulation, polymorphism. JS can simulate inheritance and encapsulation, but it cannot simulate polymorphism, so JS is an object-based language, not an object-oriented language in the traditional sense. 3. The relationship between classes and objects 1) Classes are abstract, objects are concrete (classes are the abstraction of objects, objects are the concretization of classes) 2) Classes are an abstract concept, only It can be said that classes have attributes and methods, but they cannot assign specific properties to…