Skip to content

Commit a9ed287

Browse files
devsnekcodebytere
authored andcommittedJun 9, 2020
doc: fix extension in esm example
PR-URL: #33408 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent b924910 commit a9ed287

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)
Please sign in to comment.