A simple understanding of javascript closures

Source: Internet
Author: User

Award JavaScript before the closure, let's tell you a little story.

Story background: Liu Bei and Cao Caocao time period of cooking wine, the story may be a little different, Liu Bei for Cao, Guan Yu for the spy.

Cough cough

Caocao very want to know his new Liu Bei all day tinker what;

Cao asked Liu Bei, Hyun-tak you tinker all day;

Liu Bei thought, I am how can I tell you, Labor is not to find death, beat a careless eye on the past, Caocao did not ask anything out;

Liu Bei back home, with Guan Yu said, two younger brother, Hum, Cao that silly hanging, hum!

Guan Yu also returned home at night, and said to his wife, Hum, big Brother that silly hanging, hum! I'll go and tell the Prime Minister.

Cao also can not stop, go to ask Guan Yu, Guan Yu is going to whistle, on 1510 ¥%...@?%%;

Caocao very happy back home, make a phone call to Liu Bei, married, tomorrow we come to drink ah ...

............

The JavaScript closure is done, that's the principle.

A simple understanding of javascript closures

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.