Skip to content

Commit f6e1e05

Browse files
committed
scope and closures: ch8, fixing tech mistake, closes #1646
1 parent c3dcc59 commit f6e1e05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scope-closures/ch8.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ The ESM format shares several similarities with the CommonJS format. ESM is file
286286
Instead of `module.exports` in CommonJS, ESM uses an `export` keyword to expose something on the public API of the module. The `import` keyword replaces the `require(..)` statement. Let's adjust "students.js" to use the ESM format:
287287

288288
```js
289-
export getName;
289+
export { getName };
290290

291291
// ************************
292292

@@ -305,7 +305,7 @@ function getName(studentID) {
305305
}
306306
```
307307

308-
The only change here is the `export getName` statement. As before, `export` statements can appear anywhere throughout the file, though `export` must be at the top-level scope; it cannot be inside any other block or function.
308+
The only change here is the `export { getName }` statement. As before, `export` statements can appear anywhere throughout the file, though `export` must be at the top-level scope; it cannot be inside any other block or function.
309309

310310
ESM offers a fair bit of variation on how the `export` statements can be specified. For example:
311311

0 commit comments

Comments
 (0)