Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improvements on Glossary/Hoisting #33787

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions files/en-us/glossary/hoisting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: glossary-definition

{{GlossarySidebar}}

JavaScript **Hoisting** refers to the process whereby the interpreter appears to move the _declaration_ of functions, variables, classes, or imports to the top of their scope, prior to execution of the code.
JavaScript **Hoisting** refers to the process whereby the interpreter appears to move the _declaration_ of functions, variables, classes, or imports to the top of their {{glossary("scope")}}, prior to execution of the code.

_Hoisting_ is not a term normatively defined in the ECMAScript specification. The spec does define a group of declarations as [_HoistableDeclaration_](https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#prod-HoistableDeclaration), but this only includes [`function`](/en-US/docs/Web/JavaScript/Reference/Statements/function), [`function*`](/en-US/docs/Web/JavaScript/Reference/Statements/function*), [`async function`](/en-US/docs/Web/JavaScript/Reference/Statements/async_function), and [`async function*`](/en-US/docs/Web/JavaScript/Reference/Statements/async_function*) declarations. Hoisting is often considered a feature of [`var`](/en-US/docs/Web/JavaScript/Reference/Statements/var) declarations as well, although in a different way. In colloquial terms, any of the following behaviors may be regarded as hoisting:

Expand Down Expand Up @@ -49,7 +49,9 @@ For more information on hoisting, see:

## See also

- [`var` statement](/en-US/docs/Web/JavaScript/Reference/Statements/var) — MDN
- [`let` statement](/en-US/docs/Web/JavaScript/Reference/Statements/let) — MDN
- [`const` statement](/en-US/docs/Web/JavaScript/Reference/Statements/const) — MDN
- [`function` statement](/en-US/docs/Web/JavaScript/Reference/Statements/function) — MDN
- [`var` statement](/en-US/docs/Web/JavaScript/Reference/Statements/var)
- [`let` statement](/en-US/docs/Web/JavaScript/Reference/Statements/let)
- [`const` statement](/en-US/docs/Web/JavaScript/Reference/Statements/const)
- [`function` statement](/en-US/docs/Web/JavaScript/Reference/Statements/function)
- [`class` statement](/en-US/docs/Web/JavaScript/Reference/Statements/class)
- [`import` statement](/en-US/docs/Web/JavaScript/Reference/Statements/import)