About 52 results
Open links in new tab
  1. function - How do JavaScript closures work? - Stack Overflow

    Sep 21, 2008 · A closure is a pairing of: A function and A reference to that function's outer scope (lexical environment) A lexical environment is part of every execution context (stack frame) and is a map …

  2. What is a practical use for a closure in JavaScript?

    Apr 28, 2010 · This is called a JavaScript closure. It makes it possible for a function to have " private " variables. The counter is protected by the scope of the anonymous function, and can only be …

  3. JavaScript closure inside loops – simple practical example

    Apr 15, 2009 · JavaScript closure inside loops – simple practical example Asked 16 years, 10 months ago Modified 2 years, 9 months ago Viewed 491k times

  4. What exactly does "closure" refer to in JavaScript?

    Nov 26, 2009 · From JavaScript Closures Two one-sentence summaries: A closure is the local variables for a function - kept alive after the function has returned, or A closure is a stack-frame which is not …

  5. functional programming - What is a 'Closure'? - Stack Overflow

    Aug 31, 2008 · Closure is a feature in JavaScript where a function has access to its own scope variables, access to the outer function variables and access to the global variables.

  6. Good examples for using a Closure in Javascript - Stack Overflow

    Jan 30, 2012 · Well, I recently learned about closures in Javascript. While i find it's concept truly amazing, i have yet to find a good application for them, myself. In all the blog posts, all the tuturials i ...

  7. javascript - How is a closure different from a callback ... - Stack ...

    Mar 5, 2009 · I asked a question about callbacks and arrived at another question (see comment). How is a closure different from a callback?

  8. Como funcionam Closures em JavaScript? - Stack Overflow em Português

    Jan 11, 2014 · Sempre quis saber como funcionam Closures em JavaScript, já li algumas definições mas nunca entendi muito bem. Vocês poderiam me dar uma explicação simples, objetiva mas com …

  9. javascript - Accessing variables trapped by closure - Stack Overflow

    Variables within a closure aren't directly accessible from the outside by any means. However, closures within that closure that have the variable in scope can access them, and if you make those closures …

  10. javascript closure advantages? - Stack Overflow

    Jun 10, 2011 · 3 Closures are necessary in javascript due to the fact that most API's that require callback functions (for instance, an "onclick" function) do not provide other mechanisms to send …