File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ With the following ES Modules:
213
213
214
214
``` mjs
215
215
// distance.mjs
216
- export function distance (a , b ) { return ( b .x - a .x ) ** 2 + (b .y - a .y ) ** 2 ; }
216
+ export function distance (a , b ) { return Math . sqrt (( b .x - a .x ) ** 2 + (b .y - a .y ) ** 2 ) ; }
217
217
```
218
218
219
219
``` mjs
@@ -265,7 +265,7 @@ export default class Point {
265
265
266
266
// `distance` is lost to CommonJS consumers of this module, unless it's
267
267
// added to `Point` as a static property.
268
- export function distance (a , b ) { return ( b .x - a .x ) ** 2 + (b .y - a .y ) ** 2 ; }
268
+ export function distance (a , b ) { return Math . sqrt (( b .x - a .x ) ** 2 + (b .y - a .y ) ** 2 ) ; }
269
269
export { Point as 'module .exports ' }
270
270
```
271
271
@@ -289,7 +289,7 @@ named exports attached to it as properties. For example with the example above,
289
289
<!-- eslint-disable @stylistic/js/semi -->
290
290
291
291
``` mjs
292
- export function distance (a , b ) { return ( b .x - a .x ) ** 2 + (b .y - a .y ) ** 2 ; }
292
+ export function distance (a , b ) { return Math . sqrt (( b .x - a .x ) ** 2 + (b .y - a .y ) ** 2 ) ; }
293
293
294
294
export default class Point {
295
295
constructor (x , y ) { this .x = x; this .y = y; }
You can’t perform that action at this time.
0 commit comments