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


Nathan Jackson
Nathan Jackson
8,360 Points

"Open a scope" Explanation

Hey Guys,

Super simple question. I was just wondering wether someone could explain the term "open a scope". Im just returning to the SASS segment of the Web Design track after a month or so away, and can't seem to remember hearing this term.

Probably a very n00b question but it's just stumped me!

Please and thanks!


1 Answer

Hey Nathan, here's a real quick explanation, and a more detailed one here.

Variable Scope (JavaScript) JavaScript has two scopes: global and local. A variable that is declared outside a function definition is a global variable, and its value is accessible and modifiable throughout your program. A variable that is declared inside a function definition is local. β€”Microsoft