Update
Thank you for your answer. For those who have no impression of object-oriented, I suggest you take a look at the example in Lion"s answer. After reading this example, I suddenly realized that the original object-oriented scenario is to write this kind of plug-in, that is, when common components are used at work. As an advanced step, you can refer to Meathill"s answer
. < hr >problem description
I always see such a sentence in front-end recruitment: I start to learn front-end from elevation. The business I usually do is not complex, and object-oriented complex operations are rarely used. So much so that I don"t know to what extent this aspect should be mastered in mainstream front-end development?
interview questions encountered
once interviewed Didi, encountered a topic is scene design, probably is "Didi has several kinds of cars, hitchhiking or chauffeured cars, each kind of car unit km fuel consumption, the price is different, please calculate the mileage and the total price at the end, what kind of category should be designed to describe?" I can"t do such a problem all the time. I"ve never encountered it before. If you ask me about the design pattern, I can only answer the content of the book.
confused
so please give us your advice on how to learn this object-oriented programming idea and design pattern.