Skip to content

Commit 22a989f

Browse files
devsnekcodebytere
authored andcommitted
doc: fix extension in esm example
PR-URL: #33408 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent 5dbd8ab commit 22a989f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/api/esm.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ code for reuse. Modules are defined using a variety of [`import`][] and
1616
The following example of an ES module exports a function:
1717

1818
```js
19-
// addTwo.js
19+
// addTwo.mjs
2020
function addTwo(num) {
2121
return num + 2;
2222
}
2323

2424
export { addTwo };
2525
```
2626

27-
The following example of an ES module imports the function from `addTwo.js`:
27+
The following example of an ES module imports the function from `addTwo.mjs`:
2828

2929
```js
30-
// app.js
31-
import { addTwo } from './addTwo.js';
30+
// app.mjs
31+
import { addTwo } from './addTwo.mjs';
3232

3333
// Prints: 6
3434
console.log(addTwo(4));

0 commit comments

Comments
 (0)