News for hackers. Stuff that matters.
Re:Things I Learned Writing a Fibonacci Generator in JavaScript by gravypod on Tuesday May 17, 2016 @12:08AM (#11711294)
By from I mean easily represented within.

Most people don't think of a function with an inherited scope as a closure since by the standard PLT people will tell you that Javascript does not provide "real" closures.

I'm sure you know what I meant. It's the "Javascript Way" TM of doing this.

My "little known" I mean that most programmers do not think of doing this out right. It took me seeing an amazing talk by the creator of JSON called "Javascript the Good Parts" to realize how powerful this construct was, and how Javascript made it so easy.

Re:Things I Learned Writing a Fibonacci Generator in JavaScript by dionidium on Tuesday May 17, 2016 @02:36AM (#11711712)
I'm going to push back a little further on this. Closures are fundamental to JS and widely known about and used. Crockford, too, is famous in JS circles, as is the talk you mention.
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...