Closures – Part 5 of Functional Programming in JavaScript




A short video explaining the concept of closures, using JavaScript. This is part of a series, where are learning functional programming using JavaScript.

Mozilla JavaScript documentation on Clousures
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures

Code from the episode
https://gist.github.com/mpj/b56371c672122a098d52

Playlist of full series

You want to follow me on Twitter and Quora:

http://www.quora.com/Mattias-Petter-Johansson

Original source


29 responses to “Closures – Part 5 of Functional Programming in JavaScript”

  1. I'm a complete newb so I'm a bit confused X_X

    I only have some basic student level experience with Java and this just seemed like standard scoping to me?

    Is the "scoping" in java also "closures" (the way access trickles down) and I just haven't been exposed to the terminology?

    Someone help X_X

  2. I am so happy to have found your channel! Thank you for your unpretentious explanation of these concepts. You make me feel as though it is simple and that I van easily learn this terms that have, more or less, eluded me in the abstract.

  3. I'm at 5:07.requestID is already in the sendRequest() and so is the S.ajax function-why is it amusing?When both are under the same function-for one to be able to access the other isn't no big deal right?

  4. Thanks for your helpful video.
    I've recently started learning functional programming but I am familiar with global variables in PHP and can't understand the differences between Global variables and Closures!!! What I got from your tutorial is that Closures aren't about variables, but functions and when we assign a variable actually we put it in the scope so every function can see it. please correct me if I am wrong.

Leave a Reply