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:
217217
218218``` mjs
219219// 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 ) ; }
221221```
222222
223223``` mjs
@@ -269,7 +269,7 @@ export default class Point {
269269
270270// `distance` is lost to CommonJS consumers of this module, unless it's
271271// 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 ) ; }
273273export { Point as 'module .exports ' }
274274```
275275
@@ -293,7 +293,7 @@ named exports attached to it as properties. For example with the example above,
293293<!-- eslint-disable @stylistic/js/semi -->
294294
295295``` 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 ) ; }
297297
298298export default class Point {
299299 constructor (x , y ) { this .x = x; this .y = y; }
You can’t perform that action at this time.
0 commit comments