Use inheritance in JavaScript object-oriented programming (1)

xiaoxiao2021-03-06  38

Use inheritance in JavaScript object-oriented programming (1)

A few days ago

JScript version of CollecionBase class

Used to resolve the base class that needs to be used as a class that is the primary data structure. However, there were no examples of inheritance at the time, and some netizens were more confused for JavaScript inheritance, so I used four ways to achieve four ArrayList derived classes today. About using JavaScript for object-oriented programming (OOP), there are many articles on the Internet say. Here I recommend two articles to see, if you don't understand how to use the Prototype property of JavaScript's Function object to implement class definitions and their principles, then take a closer look.

Object-oriented JavaScript programming

','

Object-oriented JScript

'with'

Classical Inheritance in JavaScript

'Oh (especially the first article and the article related to discussions), otherwise, behind the mist can't blame me. That CollectionBase is not listed. The first link is it. Here is the JavaScript 'inheritance' implemented in four ways (not quoted in the future. Construction inheritance method: