new class js -advanced
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
const distance = (
|
||||
{ x: xOrigin, y: yOrigin },
|
||||
{ x: xDestination, y: yDestination }
|
||||
) => Math.sqrt((yDestination - yOrigin) ** 2 + (xDestination - xOrigin) ** 2);
|
||||
|
||||
console.log(distance({ x: 1, y: 1 }, { x: 5, y: 1 }));
|
||||
@@ -0,0 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const logTransformedName = ({ firstName, lastName }) =>
|
||||
console.log(`${lastName}, ${firstName.charAt(0)}.`);
|
||||
|
||||
logTransformedName({ firstName: 'Ladislaus', lastName: 'Jones' });
|
||||
Reference in New Issue
Block a user