News for hackers. Stuff that matters.
Re:Things I Learned Writing a Fibonacci Generator in JavaScript by onion2k on Tuesday May 17, 2016 @01:48AM (#11711562)
People who write JavaScript in the sense of "jQuery with a few native calls", embedded in a webpage, don't tend to use closures, so searching for JS examples doesn't often throw them up. That might give you the impression they're unusual, but if you look at any substantial app you'll see them a lot. In fact, you can take a function closure and turn it in to a JS module that can be used with asynchronous loaders and dependency injection without much extra work - http://ifandelse.com/its-not-hard-making-your-library-suppor...

There are no comments on this comment yet.