Home  /  Questions  /  Question



139   96.7
Oct 22, 2013


In JavaScript, how exactly are scope and closure related?

Actually, I know that scope and closure are related, but I am not clear exactly how or in what sense. 

From what I understand scope refers to the visibility of variables (for example inside a function).   
And a closure defines the boundary of this visibility.   

Is this correct?  If so, there is a global scope, but is there also a global closure?
Could someone shed some light and post the simplest possible code demonstrating these concepts?

Thanks
Chris



0   0
9 days ago
Free robux generator become famous all over world and the lover of this are also increasing regularly the main fact for this one is it's hack tools that provides lots of facilities for the online player  http://freerobuxgenerator.net/ thanks for this awesome online unlimited fun.