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