If you are a beginner in JavaScript, it is really important to understand the concept of closures. It will save you hours of debugging.
Before we dive into the world of closures, we need to make sure that we are comfortable with the idea of scope in JavaScript.
Imagine that you are chatting with two friends, A and B, on Facebook. Whatever messages you send to A, B does not have access to them. The same goes for A. But if you create a group then everyone can see or have access to all the messages. This is because these…
Current Software Engineering student at the Flatiron School