| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent fb3ea4c commit 1eff647
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,9 +41,9 @@ or object). | |||
| 41 | 41 | Below, `bar.js` makes use of the `square` module, which exports a constructor: | |
| 42 | 42 | ||
| 43 | 43 | ```js | |
| 44 | - const square = require('./square.js'); | ||
| 45 | - const mySquare = square(2); | ||
| 46 | - console.log(`The area of my square is ${mySquare.area()}`); | ||
| 44 | + const Square = require('./square.js'); | ||
| 45 | + const mySquare = new Square(2); | ||
| 46 | + console.log(`The area of mySquare is ${mySquare.area()}`); | ||
| 47 | 47 | ``` | |
| 48 | 48 | ||
| 49 | 49 | The `square` module is defined in `square.js`: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments