Understanding javascript prototype and closure (16)-conclusion and understanding javascript

Source: Internet
Author: User

Understanding javascript prototype and closure (16)-conclusion and understanding javascript

I used a total of 15 articles to prototype and closure javascript.

First, javascript is "not easy to learn ". It is not how difficult it is, but the people who learn it often learn javascript after learning other languages. With the learning experience and practical experience of other languages, coupled with self-taught javascript, learning and using, there will certainly be many misunderstandings and detours. I have never experienced much, but it is also a lesson.

Second, prototype and closure are difficult to understand. One is that they are difficult to understand, and the other is that they both bring a lot of bugs to junior developers more or less. You can develop javascript programs without understanding the prototype and closure, but you cannot write high-quality javascript programs that comply with design principles.

Therefore, we must emphasize the basics and theories! The combination of theory and practice is not empty talk.

As a result, I often practice shooting. People who like basketball usually play basketball with others on weekends. I used to do the same before. However, from the spring of this year, I took another hour every week to practice shooting by myself. Exercise the correct shooting posture and force yourself to use the correct posture during the exercise. After a long time, muscle memory is formed.

Therefore, do not forget to charge after work.

   

I have also made reference to many materials, including blogs by many technical experts from the blog site and csdn, various javascript books, json. js source code, and jQuery source code. However, I have no specific terms or paragraphs.

Writing by yourself is not plagiarism, not graduation thesis. You must have your own thoughts and conclusions. This is true for both study and work.

All the descriptions, explanations, and examples in the previous 15 articles, including pictures, reflect my own understanding. Most of the pictures are made by myself. Before writing every article, I have to think about how to express it in order to make it easier for readers to understand and receive it.

Finally, I saw a lot of articles in a long article, so I hate to explain everything in one article. My articles are all small steps, and it is estimated that it will take 10 minutes to finish reading one article. This is an idea I found when I was reading those things of the Ming Dynasty. This book contains only a small amount of content, and has a simple language and strong vigilance. It is closely linked to a section and can stick to readers.

Therefore, when I write an article, I will first introduce the subject to a concept that everyone knows, and then explain it further. At the end of an article, you need to throw a question to lead to the next section.

The prototype and closure series fills a gap in the javascript tutorial, even though the prototype and closure are not explained in the javascript advanced programming. I hope you can provide more support.

This ends.

---------------------------------------------------------------------------

This article has been updated to the directory "deep understanding of javascript prototype and closure series". For more information, see "deep understanding of javascript prototype and closure series".

In addition, you are welcome to follow my microblog.

You are also welcome to follow my other tutorials-don't worry, they are all free!

Microsoft petshop4.0 source code explanation video json2.js source code interpretation video

--------------------------------------------------------------------------


Javascript closure and prototype

Since your B is used as a parameter of object a, it must be used as an attribute that needs to be stored and used for multiple times. If only a few methods call B, just let B be the parameter of the method ~
<Script type = "text/javascript">
Function (){}

A. prototype. say = function (B ){
Alert (B );
}
Var x = new ();
X. say ("xx ");
</Script>

If it is your incoming B parameter, it will be used in many places. It seems quite cost-effective to add a type attribute ~~

Function a (B ){
This. type = B;
}

I want to learn more about the javascript operating mechanism, such as closures, prototype chains, and scopes. What books do I recommend?

The above two authoritative guides and advanced programming can be viewed.

I recommend the essence of the javascript language written by Zhou aimin

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.