[sign in]

What's a Closure?

  1. What's a Closure?
  2. Variables and Values
  3. Defining Functions
  4. Side Effects
  5. Functions are Values
  6. Returning Functions
  7. Function Scope
  8. Nested Functions
  9. Stateful Closures
  10. Private Data
  11. Asynchronous Callbacks
  12. Continuation Passing

About the Author

I’m a software developer in Sunnyvale, CA, with wide and varied interests. Currently I’m working at NVIDIA on CUDA-related technologies, reinventing high performance computing. Because one thread just isn’t enough. Come to think of it, eight threads aren’t enough, either.

My formative years were spent writing BASIC programs on the Commodore 64. They seemed to all involve physics simulation for realtime games. I went to Whitman College and majored in physics and mathematics. Not wanting to be pigeonholed into only two disciplines, I promptly went to graduate school and ended up with a PhD in computer science.

My latest hobbies are learning JavaScript, reading up on machine learning, and playing around with video.

Philosophy of Learning

I made this site to help anyone learn about cool advanced topics in computer science. Some people can learn by reading books, but for me personally I don't really learn something until I get my hands dirty and program it up myself.

The best way to learn something is to:

I've tried to put these steps into practice in the JavaScript lessons on this site.

Nathan Whitehead

Portuguese translation by Gianpaulo Soares.

about news main