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

    Sep 21, 2008 · How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand …

  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 · That's the magic, and frustration, of closure. "JavaScript Functions close over the scope they are declared in, and retain access to that scope even as variable values inside of that scope …

  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. JavaScript closures vs. anonymous functions - Stack Overflow

    Oct 17, 2012 · JavaScript closures vs. anonymous functions Asked 13 years, 4 months ago Modified 5 years, 6 months ago Viewed 123k times

  6. Why do we have closures in JavaScript? - Stack Overflow

    Jul 20, 2010 · Am wrapping my head around JavaScript closures and am at a point where things are falling in place; i.e a closure is the local variables for a function - kept alive after the function has …

  7. 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 ...

  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 - What are Closures and Callbacks? - Stack Overflow

    Jan 15, 2010 · Javascript Closures and ‘this’ context JavaScript - How do I learn about “closures” usage? Callbacks are a simpler concept. A callback is basically where a function accepts another …

  10. Javascript closures performance - Stack Overflow

    Feb 20, 2013 · Even in tight loops, performance does not degrade that bad. Let the JavaScript engine optimize this on its own as Chrome has started doing, by removing unneeded variables from …