Why can object-oriented thinking quickly sweep the world of programming?
Because object -oriented thinking combines data and code into unity for the first time and presents it to programmers with a simple object concept. This all of a sudden, the original chaotic algorithms and subroutines, as well as tangled complex data structures, divided into clear and orderly structure of the object , so as to clarify the data and code in our hearts that group mess-like knot.
In JavaScript, everything can be considered an object for processing.
First, define an object
In addition to getting objects directly defined above, you can also use construction methods to get objects.
Ii. access to object properties and methods
1, way one: through the object name. property name, Object name. Method Name ()
2, way two: Through the object name ["Property name"]
Third, JS built-in objects
JS has built-in many objects that can be called directly. such as Array String document and so on. Understand the object-oriented thinking, learn to master these built-in objects, for future programming will bring great convenience.
V. Objects in JavaScript