Answers for "js Destructuring arguments"

0

js Destructuring arguments

const circle = {
  label: 'circleX',
  radius: 2,
};

const circleArea = ({ radius }, [precision = 2]) =>
  (Math.PI * radius * radius).toFixed(precision);

console.log(
  circleArea(circle, [5]) // 12.56637
);
Posted by: Guest on March-08-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language