Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Could someone explain what or provide a good resource regarding Execution Context and Scope?

I'm trying to wrap my head around this concept. I want to know what's going on behind the scenes and how JS actually gets read/executed. - Does Treehouse have a course for this?

Thanks

I found a good article that may help:

http://ryanmorr.com/understanding-scope-and-context-in-javascript/

Treehouse has a quick course that addresses scope, but not execution context.

https://teamtreehouse.com/library/understanding-closures-in-javascript

1 Answer

If you're looking for an in-depth treatment of how JS actually implements these concepts, Secrets of the JavaScript Ninja is a phenomenal resource. It's written by the author of JQuery, and examines in detail many features of the language. There are even detailed diagrams showing how the machine tracks execution contexts and examining what the stack looks like after a series of calls.