Hoisting, Functions, and Closure

Learn about hoisting, functions that return functions, and closures.


Functions that are defined using a function declaration are automatically hoisted to the top of a program’s scope. This means that they can be called before they’ve been defined. For example, in the following code, the function hoist() can be called before it’s actually defined:

Get hands-on with 1200+ tech skills courses.