Image for post
Image for post
Photo by Pankaj Patel on Unsplash

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.

What is the scope?

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…

Muazzam Nashat

Current Software Engineering student at the Flatiron School

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store