Scope is a set of rules which defines from where and how the variable could be accessed(or couldn’t). Javascript has a lexical scope which means that scope is based on where functions are declared(not invoked). It is defined during the compilation time.

Executional context refer to where and how the function was invoked and is created during the execution time. Context has nothing to do with the lexical scope.

Understanding both context and scope is important for a JavaScript developer. For further reading check this article on scopes and this article on this keyword. For even more details you could also check “You don’t know JS. Scope and closures” and “You don’t know JS. This and object prototypes” books by Kyle Simpson.

Enjoying the books

Thank you for reading!

Please don’t hesitate to clap if you like this article!

Front end developer based in Amsterdam. Here I write about my life as a web-developer, advise on how to get programming skills and share all kind of ideas.

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