August 28, 2017 02:06 pm GMT
Original Link: https://css-tricks.com/javascript-scope-closures/
JavaScript Scope and Closures
Scopes and closures are important in JavaScript. But, they were confusing for me when I first started. Here's an explanation of scopes and closures to help you understand what they are.
Let's start with scopes.
Scope
A scope in JavaScript defines what variables you have access to. There are two kinds of scope global scope and local scope.
Global scope
If a variable is declared outside all functions or curly braces ({}
), it is said to be …
JavaScript Scope and Closures is a post from CSS-Tricks
Original Link: https://css-tricks.com/javascript-scope-closures/
Share this article:
Tweet
View Full Article