Skip to content

Commit

Permalink
address reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Jun 18, 2022
1 parent 0cbbfff commit a5563b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ browser-compat: javascript.operators.import
---
{{jsSidebar("Operators")}}

The `import()` call is a function-like expression that allows asynchronously loading an ECMAScript module into a potentially non-module environment.
The `import()` call is a function-like expression that allows loading an ECMAScript module asynchronously and dynamically into a potentially non-module environment. Compared to the [declaration-style counterpart](/en-US/docs/Web/JavaScript/Reference/Statements/import), `import()` calls are often called _dynamic imports_ due to its syntactic and runtime flexibility.

## Syntax

```js
import(moduleName)
```

The `import()` call is a syntax that closely resembles a function call, but `import` itself is a keyword, not a function. You cannot alias it like `const myImport = import`, which will throw a `SyntaxError`.
The `import()` call is a syntax that closely resembles a function call, but `import` itself is a keyword, not a function. You cannot alias it like `const myImport = import`, which will throw a {{jsxref("SyntaxError")}}.

### Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ used in embedded scripts unless such script has a `type="module"`. Bindings
imported are called live bindings because they are updated by the module that exported
the binding.

There is also a function-like dynamic [**`import()`**](/en-US/docs/Web/JavaScript/Reference/Operators/import), which does not require scripts of `type="module"`.
There is also a function-like dynamic [`import()`](/en-US/docs/Web/JavaScript/Reference/Operators/import), which does not require scripts of `type="module"`.

Backward compatibility can be ensured using attribute `nomodule` on the
{{HTMLElement("script")}} tag.
Expand Down

0 comments on commit a5563b1

Please sign in to comment.