How to learn JavaScript?

Source: Internet
Author: User
Tags jquery library

Not too small.
Links: https://zhuanlan.zhihu.com/p/23265155
Source: Know
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.

In view of every now and then, a private student asked me ( Lao Yao, the same) how to learn the front-end problem. Here a unified reply, such as the next time you meet ask me this question classmate, directly to the article link address sent to you.

First of all, say something off-topic. About someone calling me the big God. Personally feel that when you buy things, they call you handsome, you agree or not.

The beginning, "How to learn the front-end" should be different, others ' methods may not be suitable for themselves. Let's talk about My Learning method: I put most of my time on learning JS. Because of this JS learning curve, first flat and then steep. Project practice and practice what, I do not say, the main point of work outside the time to use the problem. How do I learn, reading, analysis of the source code . Individuals these days statistics, front-end books currently read more than 50, most of them are JS. Almost all the books on the market have been read.


The first question is, what good is reading?

The benefits should be unspoken and clear, the book to see more, the foundation will gradually tamp up. See more, their own judgment, naturally came up. Look at other people's articles, you can quickly determine the other side of each piece of the right, which block is not clear, ambiguous. Of course, to see the source code, analysis of source code provides the basis.

10 Book read 2 times the benefits should be greater than a book read 20 times . 10 The intersection of the book, that is the core of the basic knowledge, and set that is all knowledge. A good book, of course, should read more and read repeatedly. But reading one book is not going to work. Because the focus of each book is different. From different sides, to understand a knowledge point, it is very meaningful.

So especially admire the Indians, he speaks English with you, you do not understand a word, he will pop out n the same meaning of the word, you understand one, OK. Read the same way, a piece of the story is not thorough, do not worry, other books can help you to understand.



The second problem is that books are recommended.

Personally feel good, nothing can be turned over. The books are as follows:

>JavaScript Object-oriented Programming Guide, Easy-to-understand style, more suitable for beginners, the prototype of the piece spoke thoroughly, 12 ways to inherit.

>"JS authoritative guide", "JS Advanced Program Design", these two books classic is classic, but too thick, suitable for any of the chapters as a book to read. Voluminous, it's hard to read it in a breath. More suitable as reference books.

>"You don't know JavaScript" Sniper JS core details, closures, prototypes, this is also clear. At present, "in the book" also out, still looking.

>"JS design mode and Development practice"JS design mode is also to learn, this book to JS design mode is very clear, not obscure, it does not seem much difficulty.

>"Regular Guide", when analyzing the source code, if the regular expression does not understand, can not go on. The book is relatively clear in comparison.

>"MVC-based JavaScript Web rich application development", after reading, basically can write their own MVC framework. This is a good book.

>javascript Functional Programming, JS is a functional language, this book is a functional programming a primer, function is first-class citizens that is very important.

>"js ninja Cheats", the JQ author wrote, no legendary so difficult to read, saying that even if you read and understand all knowledge points, will not reach the world master level. Because you're not doing what you want.

>javascript Framework Design, if you look at this book, you will find that the book is suspected of listing code. In my opinion, this book is about the overall view of the framework. The above books are what I think is the way to achieve the master must see, but also need to look at repeatedly.


CSS related books, to tell the truth I see relatively little, a total of six or seven. There are two books that must be recommended:

>"CSS authoritative guide", CSS basic knowledge point that is very clear. What cascade priority, line-height what. It's not just a book that's called "the Authoritative guide."

>"CSS Secrets", this book I also constantly see, this book is not disdain to fully talk about the properties of CSS3. The CSS specification document can speak, it will only say that you least care about. The 47 issues solved by this book are equally important and instructive for solving ideas and solutions. You can not buy the above books, at least buy this book.



The third question, how to see.

Presumably a lot of students, all want to read, but it is very difficult to see down. The text part is also able to see relatively, the scalp is numb when the code is encountered. I also encountered this problem at the beginning.

Say a learning theory. For example, learning English, there is a theory of boiling water. Vocabulary must reach 6000, if not reached, the English level will not go up, this is like boiling water, nothing burns, cool cold, never burned to 100 degrees, then this water is never drink. Once it has boiled, you can drink it at any time.

20 books You can't see, what does it mean? you haven't read any of the books. . familiar, is always just the first three chapters. Don't laugh, I was the same.

So now the question is, how to read a book? very simple, knock . "MVC-based JavaScript Web rich application Development" when I look at it, that's it, and one day, I was determined to knock the book over. Words and code are knocked, and then a chapter to see finished. Once you've hit the code, you'll find that it's not as hard as it looked before.

If you belong to a book on the sleepy kind of classmates. It is highly recommended that you knock the JavaScript Object-oriented Programming guide from the beginning to the end of the book. After reading a book, Faith comes up. First of all to ensure that after reading a book, after reading 3, the basic should be able to do a few days to read a copy. It's hard to start everything, come on.



Question fourth, the level of reading.

After reading the book, to summarize, to compare with other books to see. There are students at the same time to see the "Authoritative guide" and "Gao She" came. Casually take out a knowledge point, you can close your eyes to speak well, explain the level enough.

The next piece is the source of the study . Look at the framework source code before, want to say one thing: Dom API does not understand, no problem, you can Baidu.

But the regular must first study the research, otherwise most people to try to analyze the source code, encountered setbacks are in this.

How to read the source code? Knock, Knock.

What code is worth knocking on? Good frame or library source is worth knocking on. But take JQ to knock, to get started, that's not going to work. Reason: too long for him. Eight thousand or nine thousand lines!!

Personally think the Underscore.js Library is a good first choice. The reason is the tool method, after knocking their own level should be slightly small. In fact, there are some API implementation, you have to think of it as getElementById, deep printed in the brain. For example extend method, must be mouth to come. After knocking on the underscore library, consider reading the JavaScript functional programming book.

JQ source code is not good to knock. Then the source of Zepto less than 1800 lines, knocking on the day should be knocked out. After knocking a few times, all do not understand the place, are Baidu clear, and then can write their own class JQ library. Then you can write it as a skill in your resume. For example, "Create your own jquery library." Of course, the process of knocking can also help to understand the JQ API.

Then there is the backbone.js, because this framework is based on the class JQ and underscore MVC framework. The code does not have many lines. Knock it. Spine.js is similar to backbone. Before you hit it, look at the "MVC-based JavaScript Web rich app development". I hope your resume can add such a pen, "Create your own MVC framework."

Other, I've knocked on some. Includes Jq.validate.js, including some plugins. If you like, bootstrap you can go knocking. Source is very many, you can press the plug-in one by one to knock. Analysis understand, carousel, paging, dropdown boxes, and so on plug-in that is not minutes to write one at a moment. At the very least, look at the API interface is how the design is also excellent. In other words, people have learned a lot from reading their CSS code. Speaking of plugins, there are two must mention, one is the table plug-in, one is a tree. All knocked out, the resume can be written, "Create your own UI framework."

Of course, you can also knock on your favorite frame code, it is important to understand its implementation principle , it is best to understand why the design, if the design patterns are familiar with, will often find that the original is so.

According to knock just analysis of the source of the introduction, use is to learn, and finally can be used in their own projects, that is the right path. Even if it doesn't work, it's a good way to pass the time, much stronger than watching TV. When I was bored, I knocked on the underscore source. Finally, if you can write those words on your resume, you must be a great God. Come on.



Postscript

The original purpose of writing this article, as the article said at the beginning, to facilitate the reply to your questions. This site of any sharing learning experience of the article, the basic will resonate, this is really a topic worth discussing. Here are a few more things to talk about.


> Someone asked me the front-end work experience.

Not a few years. More than three years.

> Beginner or Novice (beginner) what to do?

Reading and analyzing the source code is an important way to improve, but not for beginners. Beginners need to be able to quickly get started and into the business, can quickly get started. A quick way to learn is to watch video. As some students say, know what, how to use it.

Watching video is good, first of all it is a passive way of learning. The first thing I started was to watch the video, just to see it. Do not understand again, put again, I basically is 1.5 times times to see.

And reading is a kind of active way, need oneself page by page turn over. Need to be self-motivated to understand. And a lot of things, maybe just a video teacher a word, you can highlight the focus, we need to read our own. There is another thing is, such as found oneself some knowledge point is not clear, can go to Baidu alone. For example, this is a lot of articles. This learning style is also a good way to quickly grasp the knowledge point.

Books need technical review, so look at the article must look at the review. But the video is not good to say, the video is generally not too deep, and occasionally there are mistakes. I was also misled by some video, suggest looking for a good video to see. The major website training institutions free video is quite a lot of.


> Reading and analyzing the source of the time.

But has been working a year, it is a good time to improve, at this time can go to read. A comprehensive system of carding knowledge points, clearing their own blind area. If just rely on project experience is not enough, through the project to learn, that must be necessary, the work itself is a learning process.

But if you don't read a book for three years, how much can you learn? Not to mention that every project is very similar, has been in the comfort zone, that is really 5 years of experience to repeat the first year. So I do not agree with this sentence: The interview stressed that their ability to learn is not a strong ability to work performance. The level of 3 years of experience is entirely likely to exceed 5 years.


> Don't have time to study?

If you have not graduated, you have been in this site every day mixed, in fact, you lead a big step. Are mixed with the university, every day is full of LOL and TV show accompany, I just want to say into the community is to also. What's the scariest thing? It is still, not yet (these words are not read wrong). Time is there, it depends on you willing to pay not. After work, study on weekends, holidays when others play, at home knocking code, so as to lead others.


> Interest issues?

Interest and expertise are a benign iterative cycle. You are good at something, the more you like it, the more you like it, the more willing you are to spend your time, and the better you are. This truth is understood, but lacks a trigger.

If you like to play games, you might actually be a great fit for the front end. Playing the game is a feedback mechanism, front-end work feedback, relative to other work is also very timely. Code changes, Web page A brush, you see the effect. Good, superior, sense of accomplishment are often linked together. Every reading of a book, I feel a sense of accomplishment. There is also a sense of accomplishment when you knock down a library.


The above is purely opinion, everyone's study habits, manner, attitude are different. First correct attitude, find their own learning methods, and then develop the habit of sticking to it. Finally say, you and I share: As long as you go on the right path, no matter how slow, is to go forward!

The end of this article.

Sorry, accidentally opened the front-facing camera!

Article Source: Unified Reply "How to learn JavaScript?" " front End net Lao Yao (reprint has obtained the author permission)

How to learn JavaScript?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.