What's a Closure?
Ever wonder what closures are and how they work? You can learn about this advanced programming concept right now through interactive lessons in JavaScript.
Let's get started!
Here is an example of some JavaScript code. Doesn't it look pretty?
Don't worry, we're not just going to sit around and look at pretty code. We're going to be writing code!
Variables
Here's code that declares x is a variable, and then assigns x the value 5.
Now you try. Declare that y is a variable and then assign it the value 7. Click "submit" when you think you have it.
1:1