Destructuring Syntax
: Allows you to extract parts of an array or obj intro distinct variables.callback
is always a function that is being passed into another function.Anonymous Callback
: When we use a function expression directly.Math.sqrt
built in function being passed directly in as an argument.First-Class Object
: A type that supports the same basic operations as most other types. (i.e. Numbers, Strings & Booleans)Higher-Order Function
: A function that should either accept another function as an argument, or return a function as an output.scope
of a program in JS is the set of variables that are available for use within the program.Security
: Adds security by ensuring variables can only be access by pre-defined parts of our program.Reduced Variable Name Collisions
: Restricts re-using variable names; helps prevent overwriting variable names.Global Scope
window
obj in the browser and the global
obj in Node.js.Local Scope
Block Scope
Scope Chaining
: When a variable is not found within the immediate scope, JS will keep searching outwards until it matches the one we are referencing.Lexing Time
: When you run a piece of JS code that is parsed before it is run.let
: can be re-assigned; block-scoped.const
: no re-assignment; block scoped.var
: May or may not be re-assigned; scoped to a function.Hoisting
is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution.Temporal Dead Zone
: The time before a let or const variable is declared.global scope
.Lexical Environment
: Consists of any variables available within the scope in which a closure was declared (local inner, outer, and global).Scope
: Refers to the visibility and availability of variables.Context
: Refers to the value of the this
keyword when code is executed.this
?This
: Keyword that exists in every function and evaluates to the object that is currently invoking that function.object.method(arg)
. (i.e. array.push, str.toUpperCase()Context
refers to the value of this within a function and this
refers to where a function is invoked.this
is called using normal function style invocation, our output will be the contents of the global object.global.setTimeout()
: popular method of setting a function to run on a timer.use strict
at the top of our program.bind()
is to make a function that, no matter how it is called, is called with a particular this value".=>
: A more concise way of declaring a function and also considers the behavior of this
and context.this
lexically.this
inside an arrow function is not dependent on how it is invoked.this
.