3 ms·
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 do
by onion2k 11y ago
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-support-amd-and-commonjs/ http://ifandelse.com/its-not-hard-making-your-library-suppor...