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 @@ -217,7 +217,7 @@ With the following ES Modules:
217
217
218
218
``` mjs
219
219
// distance.mjs
220
- export function distance (a , b ) { return ( b .x - a .x ) ** 2 + (b .y - a .y ) ** 2 ; }
220
+ export function distance (a , b ) { return Math . sqrt (( b .x - a .x ) ** 2 + (b .y - a .y ) ** 2 ) ; }
221
221
```
222
222
223
223
``` mjs
@@ -269,7 +269,7 @@ export default class Point {
269
269
270
270
// `distance` is lost to CommonJS consumers of this module, unless it's
271
271
// added to `Point` as a static property.
272
- export function distance (a , b ) { return ( b .x - a .x ) ** 2 + (b .y - a .y ) ** 2 ; }
272
+ export function distance (a , b ) { return Math . sqrt (( b .x - a .x ) ** 2 + (b .y - a .y ) ** 2 ) ; }
273
273
export { Point as 'module .exports ' }
274
274
```
275
275
@@ -293,7 +293,7 @@ named exports attached to it as properties. For example with the example above,
293
293
<!-- eslint-disable @stylistic/js/semi -->
294
294
295
295
``` mjs
296
- export function distance (a , b ) { return ( b .x - a .x ) ** 2 + (b .y - a .y ) ** 2 ; }
296
+ export function distance (a , b ) { return Math . sqrt (( b .x - a .x ) ** 2 + (b .y - a .y ) ** 2 ) ; }
297
297
298
298
export default class Point {
299
299
constructor (x , y ) { this .x = x; this .y = y; }
You can’t perform that action at this time.
0 commit comments