What is Closure Scope?

Bhaiya, I didn’t get how closure works. I got confused how did the initial value changed in the example
Can you please explain closure in depth

@devanshagarwalla in javascript you can nest functions, and the innerfunction has access to the variables of the outer function, that’s where closure comes in. Closure means that an inner function always has access to the vars and parameters of its outer function, even after the outer function has returned.. Give it a read
https://www.tutorialsteacher.com/javascript/closure-in-javascript#:~:text=Closure%20means%20that%20an%20inner,create%20nested%20functions%20in%20JavaScript.&text=This%20is%20called%20Closure.,return%20another%20function%20in%20JavaScript.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.