Skip to content

Instantly share code, notes, and snippets.

@cramhead
Last active September 9, 2019 02:24
Show Gist options
  • Save cramhead/d6a0ff8698e590113af09a2c3de63917 to your computer and use it in GitHub Desktop.
Save cramhead/d6a0ff8698e590113af09a2c3de63917 to your computer and use it in GitHub Desktop.
A set of terms for JavaScript

Temporal Dead Zone: term that expresses that time between which a variable is available due to it being in a valid scope and exists, i.e. is declared.

Early Activation: When a function expression has not yet been defined it can still be referenced, as long as it's not called.

Function Hoisting: All functions are available to be called when entering a scope where they are defined; as if they were hoisted to the top of the scope

Bound Variables: Variables associated with scope, e.g. parameters and local variables

Free Variables: Variables available via the enclosing environment. For example, a A function can define another function B within it. The variables defined in A, available in B.

test('bound', t => {
    function A(){
        const a = 10;
        function B(){
            assert.equal(a, 10);
        }
    }
})

Closure: Is a reference to a free variable at the time a function was created. All functions are closures.

Type: A type is set of (allowable) values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment