1. The basis of object-oriented
Objects are the basis of JavaScript. At the most basic level, an object is a collection of properties.
1, Creation of objects
]
I believe many friends are interested in these creations I have been exposed to the object's method many times, and I am very familiar with it.
2. Use of objects
Unlike other object-oriented languages, JavaScript does not have the concept of classes. In JavaScript, any function can be instantiated as an object.
If you need to introduce external Js, you need to refresh to execute
]
This code passes new User () to create a new object of the function. The new object created has a name attribute, and the constructor attribute points to the function that created it. 3. Public methods
Public methods are always accessible to users in the context of the object. To implement this method, you need to use the prototype attribute-prototype.
[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
] 4, private Method
[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
] [Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
]
[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute ]
2. Summary It is very important to understand the concepts and content described in this chapter. This is the starting point for fully mastering professional JavaScript.