Too Long; Didn't Read
Global Scope is the first part of understanding scopes in Javascript. Local Scope occurs when you create a variable inside a function, not a global one. Local scope can be divided into two scopes: Function Scope and Block Scope. Until ES6, Javascript only had function scope which is what I have been explaining so far. In Javascript, when you define a variable in global scope and then in local scope, local one takes precedence. Local variables are not accessible and are destroyed as soon as their scope ends.