The empirical path to learning JavaScript
This article mainly introduces how to learn JavaScript? The experience of seniors, that is, how to learn front-end, has certain reference value. Interested friends can refer to it
Since from time to time, some students send me private messages asking me how to learn front-end.
Here is a unified reply. If I encounter a classmate who asks me this question next time, I will directly send you the link address of this article.
First of all, let me digress. About someone calling me a great god.
Personally, I feel like this is the same as when someone calls you a handsome guy when you are shopping. It doesn’t matter whether you agree or not.
Let’s start with the topic. How to learn the front-end should vary from person to person. Others’ methods may not be suitable for you.
Let’s talk about my learning method.
I spend most of my time learning js. Because the learning curve of this js is flat at first and then steep.
I won’t talk about project practice and exercises, but mainly talk about the use of time outside of work.
How did I learn? Reading books and analyzing source code.
I have made statistics in the past few days and I have read more than 50 front-end books so far. Most of them are js. I have read almost all the books on the market.
The first question is, What are the benefits of reading?
The benefits should be self-evident. If you read too many books, the foundation will gradually be solidified.
After seeing too much, your own judgment will naturally improve.
Reading other people's articles, you can quickly judge whether each part of what the other person said is correct or not, and which part is unclear or ambiguous to you.
Of course, it also provides a basis for looking at the source code and analyzing the source code.
The benefits of reading 10 books twice should be greater than reading one book 20 times.
The intersection of 10 books is the core of basic knowledge, and the union is all knowledge.
Of course, good books should be read more and repeated. But reading just one book won’t do.
Because the focus of each book is different. It is very meaningful to understand a knowledge point from different aspects.
So I particularly admire Indians. When they speak English to you, if you don’t understand a word, they will pop up n words with the same meaning. If you understand one, it’s OK.
The same is true for reading books. If you don’t explain a certain part thoroughly, don’t worry, other books can help you understand.
The second question is, book recommendations.
I personally think it’s good, you can read it if you have nothing to do. The books are as follows:
> "Javascript Object-Oriented Programming Guide", the style is easy to understand, more suitable for beginners, the prototype is thoroughly explained, and the 12 inheritance methods Woolen cloth.
##>"JS Authoritative Guide" and "JS Advanced Programming", these two books are classics, but they are too thick. It is suitable to regard any one chapter as a A book to read. It's so eloquent that it's hard to read it all in one sitting. More suitable as a reference book.
>"JavaScript You Don't Know" focuses on the core details of js, including closures, prototypes, and this. The "Second Volume" is now out, and I'm still reading it.
> "JS Design Patterns and Development Practices" JS design patterns also need to be learned. This book explains the JS design patterns very clearly and is not obscure at all. Read It's not that difficult to get up.
> "Regularity Guidelines", when analyzing source code, if you don't understand the regular expressions, you won't be able to proceed. This book is relatively clear.
>After reading "JavaScript Web Rich Application Development Based on MVC", you can basically write your own MVC framework. It's a good book.
>"Javascript Functional Programming", js is a functional language, this book is an introduction to functional programming, functions are first-class citizens, that is very important of.
> "JS Ninja Secrets", written by the author jq, is not as difficult to read as the legend says. Even if you read and understand all the knowledge points, you will not be able to read it. Reaching the level of a world expert. Because you haven't done whatever you want.
>"Javascript Framework Design", if you read this book for the first time, you will feel that this book is a list of codes. In my opinion, this book focuses on the overall view of the framework.
> "The Authoritative Guide to CSS", which explains the basic knowledge of CSS very clearly. What are the stacking priorities, line-height, etc. Not just any book can be called the "definitive guide".
> I keep reading the book "CSS Revealed", but this book doesn't even bother to talk about the various properties of CSS3 in a comprehensive way. What the CSS specification document can talk about, it will only talk about what you least care about. The 47 problems solved in this book are equally important as the solutions and are very inspiring. You don’t have to buy any of the above books, at least buy this book.
The third question, how to look at it.
I believe that many students want to read books, but it is difficult to continue.
The text part is relatively easy to read, but when I encounter the code, my scalp becomes numb.
I also encountered this problem at the beginning.
Tell me a learning theory.
For example, when learning English, there is a boiling water theory.
The vocabulary must reach 6000. If it is not reached, the English level will not improve.
This is the same as boiling water. It is okay to boil it and let it cool. It has never been boiled to 100 degrees, so this water is Never drink it.
Once boiled, you can drink it at any time.
20 If you can’t stand this book, what does it mean?
You have never finished any book. What is familiar is always only the first three chapters. Don't laugh, I used to be like this too.
Then the question now is, how to finish reading a book?
Very simple, knock.
When I read the book "JavaScript Web Rich Application Development Based on MVC", that was it. Finally one day, I made up my mind to read this book from beginning to end.
Type the text and code, and then you have to read chapter by chapter. After typing the code, you will find that it is not as difficult as it seemed before.
If you are the kind of student who gets sleepy when reading a book. It is strongly recommended that you read the book "JavaScript Object-Oriented Programming Guide" from beginning to end.
After persevering in reading a book, my confidence will rise. Make sure you finish reading one first. After reading three books, you should be able to read one in a few days. Everything is difficult at the beginning, so go for it.
The fourth question is the level of reading.
#After reading the book, you should summarize it yourself and compare it with other books. Some students read "The Authoritative Guide" and "High Design" at the same time. Take out any knowledge point and you can explain it clearly and logically with your eyes closed, which means your level is sufficient.
The next step is to learn the source code.
Before looking at the source code of the framework, I want to say one thing: If you don’t understand the dom API, no problem, you can use Baidu. But the rules must be studied first.
How to read the source code?
Knock, keep knocking.
What codes are worth knocking? The source code of excellent frameworks or libraries is worth checking out.
But using jq to knock on and get started, that won’t work. Reason: Too damn long. Eight or nine thousand lines! !
Personally, I think
is a good first choice. The reasons are all tools and methods. After finishing the knocking, my level should be slightly improved. In fact, there are some API implementations. You should treat it like getElementById and imprint it deeply in your mind. For example, the extend method must be used with open mouth. After finishing the underscore library, you can consider reading the book "Javascript Functional Programming".
The source code of jq is not easy to type. Then the source code of
is less than 1800 lines, which should be completed in one day. After typing a few times, Baidu will clarify all the things you don’t understand, and then you can write your own jq-like library. Then you can write it as a skill in your resume. For example, "I have created my own jquery library". Of course, the process of typing can also help you understand jq’s API.
Then
, because this framework is an mvc framework based on classes jq and underscore. There are not many lines of code. Knock it on. spine.js is similar to backbone. Before knocking on it, you can first read the book "JavaScript Web Rich Application Development Based on MVC". I hope you can add this to your resume, "Created your own MVC framework."
I also knocked on some others. Includes jq.validate.js, including some plugins.
If you want, you can knock on bootstrap. There is a lot of source code, you can type it one by one according to the plug-in.
At least it would be great to see how other people’s API interfaces are designed. By the way, I also learned a lot from reading its css code.
Speaking of plug-ins, there are two that must be mentioned, one is the table plug-in and the other is the tree. After finishing all the typing, you can write in your resume, "Created my own UI framework."
Of course, you can also type the framework code you like. The important thing is to understand its implementation principle. It is best to understand why it is designed as it is. If you are familiar with design patterns, you will often find that it is like this. Something happened. . .
Following it is just an introduction to source code analysis. It is also used for learning. Finally, if you can use it in your own projects, that is the right way.
Finally, if you can write those few sentences on your resume as expected, you must be a great person. Come on.
Postscript: The original purpose of writing this article is, as mentioned at the beginning of the article, to facilitate my reply to everyone’s questions.
Any article on this site that shares learning experience will basically resonate. This is indeed a topic worth discussing.
Let’s talk about a few more things here.
The above is the detailed content of The empirical path to learning JavaScript. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



How to use WebSocket and JavaScript to implement an online speech recognition system Introduction: With the continuous development of technology, speech recognition technology has become an important part of the field of artificial intelligence. The online speech recognition system based on WebSocket and JavaScript has the characteristics of low latency, real-time and cross-platform, and has become a widely used solution. This article will introduce how to use WebSocket and JavaScript to implement an online speech recognition system.

Face detection and recognition technology is already a relatively mature and widely used technology. Currently, the most widely used Internet application language is JS. Implementing face detection and recognition on the Web front-end has advantages and disadvantages compared to back-end face recognition. Advantages include reducing network interaction and real-time recognition, which greatly shortens user waiting time and improves user experience; disadvantages include: being limited by model size, the accuracy is also limited. How to use js to implement face detection on the web? In order to implement face recognition on the Web, you need to be familiar with related programming languages and technologies, such as JavaScript, HTML, CSS, WebRTC, etc. At the same time, you also need to master relevant computer vision and artificial intelligence technologies. It is worth noting that due to the design of the Web side

WebSocket and JavaScript: Key technologies for realizing real-time monitoring systems Introduction: With the rapid development of Internet technology, real-time monitoring systems have been widely used in various fields. One of the key technologies to achieve real-time monitoring is the combination of WebSocket and JavaScript. This article will introduce the application of WebSocket and JavaScript in real-time monitoring systems, give code examples, and explain their implementation principles in detail. 1. WebSocket technology

Essential tools for stock analysis: Learn the steps to draw candle charts in PHP and JS. Specific code examples are required. With the rapid development of the Internet and technology, stock trading has become one of the important ways for many investors. Stock analysis is an important part of investor decision-making, and candle charts are widely used in technical analysis. Learning how to draw candle charts using PHP and JS will provide investors with more intuitive information to help them make better decisions. A candlestick chart is a technical chart that displays stock prices in the form of candlesticks. It shows the stock price

Introduction to how to use JavaScript and WebSocket to implement a real-time online ordering system: With the popularity of the Internet and the advancement of technology, more and more restaurants have begun to provide online ordering services. In order to implement a real-time online ordering system, we can use JavaScript and WebSocket technology. WebSocket is a full-duplex communication protocol based on the TCP protocol, which can realize real-time two-way communication between the client and the server. In the real-time online ordering system, when the user selects dishes and places an order

How to use WebSocket and JavaScript to implement an online reservation system. In today's digital era, more and more businesses and services need to provide online reservation functions. It is crucial to implement an efficient and real-time online reservation system. This article will introduce how to use WebSocket and JavaScript to implement an online reservation system, and provide specific code examples. 1. What is WebSocket? WebSocket is a full-duplex method on a single TCP connection.

JavaScript and WebSocket: Building an efficient real-time weather forecast system Introduction: Today, the accuracy of weather forecasts is of great significance to daily life and decision-making. As technology develops, we can provide more accurate and reliable weather forecasts by obtaining weather data in real time. In this article, we will learn how to use JavaScript and WebSocket technology to build an efficient real-time weather forecast system. This article will demonstrate the implementation process through specific code examples. We

JavaScript tutorial: How to get HTTP status code, specific code examples are required. Preface: In web development, data interaction with the server is often involved. When communicating with the server, we often need to obtain the returned HTTP status code to determine whether the operation is successful, and perform corresponding processing based on different status codes. This article will teach you how to use JavaScript to obtain HTTP status codes and provide some practical code examples. Using XMLHttpRequest
