• Coding

    What I learned today | Functional Javascript: Variables Scope and Closures

    Remember the Book: Functional JavaScript   So chapter 3 right?…hm Scopes From my understanding, where a variable lives, while the extent of a scope means how long a variable holds a value. Global Scope This has the longest lifespan when you declare a variable without the var, you are defining a global variable (accessible to every function and method in the program) Lexical Scope refers to the visibility of a variable and its value If I understood correctly, the closest variable value takes precedence Dynamic Scope The value at the top of the stack in a binding is the current value The poison of dynamic scoping (quote): the value of…

Enjoy this blog? Please spread the word :)

error: Content is protected !!