Subconsciously, you will not use object-oriented thinking to write JavaScript code, and you will rarely have a deep understanding of concepts such as prototype and closures. This results in often poorly written code.
For learning JavaScript, perhaps the most important thing is to mentally realize that JavaScript is not a toy language. The role of JavaScript goes far beyond adding form validation. We can look at GMail and Google Maps. If developers don’t respect JavaScript enough, it is unlikely that they can write such excellent web applications.
The threshold for JavaScript is very low, but low threshold does not mean it is easy to master. To a certain extent, the ease of getting started with JavaScript and its great flexibility make it difficult to master JavaScript. From a pure language perspective, my personal experience is that learning JavaScript is more challenging than learning Java. Most of us are accustomed to the traditional object-oriented expression method. To a certain extent, we even think that concepts such as class, encapsulation, and inheritance must be like Java and C. We may have never thought that concepts such as class, extend, override, etc. can also be oriented. object. JavaScript's object-oriented approach breaks this ideological shackles: the world is diverse, and all roads lead to Rome. To exaggerate, learning JavaScript in depth is more of an ideological challenge that can activate your thinking, expand your horizons, and even change your view of the world.
What has been said above is not intended to exaggerate the role and difficulty of JavaScript. Everyone will more or less emphasize the knowledge they have learned, but here, I hope that I can convey a point of view very objectively: no matter what language, it is not easy to be proficient; If you want to learn If you want to learn a certain language, you must respect it mentally and learn it on the basis of respect. Only then can you master the essence of the language. In addition to JavaScript, let’s take another example of HTML:
We often hear this: HTML is so easy, it only takes a day or two to master it. I thought so myself. But as my experience in using HTML grows, I gradually feel that HTML can be said to be the most difficult for Web front-end development. The 91 elements in the HTML4.01 specification are just like the 2,500 common characters in Chinese characters. We should all know the common characters after finishing elementary school, but it is not easy to write an excellent article using Chinese characters. The same is true for HTML. Most developers who claim that HTML is easy often only know tags such as body, p, form, table, div, ul, etc. They don't even know the tags that are not uncommon such as dl, legend, sub, caption, etc. know. It’s really arrogant to claim that HTML is easy when you still don’t recognize all the commonly used words. (The difficulty of HTML lies in how to use tags to build well-structured and semantically rich code, just like writing a composition. You can’t think that knowing a few words means you can write brilliantly.)
In short, language There is no difficulty or difficulty. Only by respecting and valuing a language mentally can it be possible to master it. Otherwise, you will always be outside the palace of professional programmers.