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:
212212
213213``` mjs
214214// 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 ) ; }
216216```
217217
218218``` mjs
@@ -264,7 +264,7 @@ export default class Point {
264264
265265// `distance` is lost to CommonJS consumers of this module, unless it's
266266// 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 ) ; }
268268export { Point as 'module .exports ' }
269269```
270270
@@ -288,7 +288,7 @@ named exports attached to it as properties. For example with the example above,
288288<!-- eslint-disable @stylistic/js/semi -->
289289
290290``` 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 ) ; }
292292
293293export default class Point {
294294 constructor (x , y ) { this .x = x; this .y = y; }
You can’t perform that action at this time.
0 commit comments