programming methods can be divided into: process-oriented and object-oriented
Process oriented: process-oriented is our original way of programming, it is based on the computer's thinking mode of programming, the disadvantage is that it is difficult to use this programming when encountering more complex programs.
----------
Object-oriented: Everything is object, real life every real thing can be called object, object-oriented it is the way of thinking that mankind has ever had.
For example: We see a car first we will pay attention to its color, size, price, style and so on, these things called attributes or features. And then we'll think about what this car can do, like this, which is called a method or a behavior. And for none of us to see a departure we will not pay attention to how it was produced.
Object-oriented:
1. Attributes (features)
2. Method (behavior)
A class is an abstraction of an object that cannot be seen or touched, such as a computer, a student, an animal, or a class. And the object is the form of a class or a concrete instance is a real thing, such as Lenovo U200, Dell z5200 This is the specific manifestation of the computer class, is a real thing.
in philosophical terms, it is the relationship between universality (generality) and particularity (individuality). Universality in the particularity, and through the special manifestation, no particularity there is no universality. The two are interdependent and common, and are dialectical and unified.
here is how to use object-oriented programming ideas in the JAVASCRIP environment to write programs, the code is as follows:
function people (Name,age) {
THIS.name = name;
This.age = name;
This.run = function () {
Alert (this.name+ "Run and Run")
        }
    }
var P1 = new People ("chubby");
alert (p1.name+ "" +p1.age);
p1.run ();
inherit
Inheritance is the method and property that child elements can inherit from a parent element. The purpose of inheritance is to implement reuse, with inherited child elements not only having attributes and methods of the parent element but also adding some of their own properties.
Inheritance can be divided into false inheritance and true inheritance.
In order to achieve the purpose of inheritance can use object impersonation to achieve the purpose of inheritance
1. THIS.A = PEOPLE;THIS.A ( Name,age);d ELETE.THIS.A (where A is the impersonating object is not a true inheritance)
2. people.call (this.name,age)
3. People.apply (this.[ Name,age])
prototype chain inheritance (true inheritance)
Man.prototype = new People;
This.constructor (name,age);
Process-oriented and object-oriented programming