In the vernacular, scope and context have a lot in common. Which is why I get confused when I read references to both, such as in the quote below from an article on closures:
Scope refers to where variables and functions are accessible, and in what context it is being executed. (@robertnyman)
As far as I can tell, context is just a reference to an object.
Can someone please explain what exactly is context, as used, for instance, in the jQuery syntax, $(selector, context)
. And is an object's scope the same at it's context?
Update:
I found this interesting article that talks about both scope and context in JavaScript.