Hoisting, Functions, and Closure

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

Hoisting

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 1400+ tech skills courses.