What is a JavaScript closure

Source: Internet
Author: User
Tags closure

Closures are closely related to functions, which is a dynamic environment in which the code of a function is running, and it is a concept of running time.

A closure is a function of a lexical representation that includes variables that do not have to be evaluated. That is, the function can use variables defined outside the function.

In the programming language, the so-called closure refers to a section where the grammatical domain is located in an area of a certain object and has the ability to continuously perform non-persistent variable values on the execution domain beyond its own scope. The non-persistent variables of these external execution domains magically preserve their values at the time the closure was originally defined (or created).

What is a JavaScript closure

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.