Skip to content

Commit

Permalink
feat: improvements on Glossary/Hoisting (#33787)
Browse files Browse the repository at this point in the history
feat: improvements
  • Loading branch information
PassionPenguin committed May 28, 2024
1 parent d9dea82 commit 9fd171a
Showing 1 changed file with 7 additions and 5 deletions.
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)

0 comments on commit 9fd171a

Please sign in to comment.