Dofactory.com
Dofactory.com
 Back to list
Views:   3.7K
Replies:  0
Archived

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
Christopher Ronny, Oct 22, 2013
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.