Destructure Object for use in function

PHOTO EMBED

Fri Oct 14 2022 19:18:08 GMT+0000 (Coordinated Universal Time)

Saved by @mmerkley #html

const stats = {
  max: 56.78,
  standard_deviation: 4.34,
  median: 34.54,
  mode: 23.87,
  min: -0.75,
  average: 35.85
};

// Only change code below this line
// const half = (stats) => (stats.max + stats.min) / 2.0;

const half = ({max,min}) => ((max + min) / 2.0);

console.log(half(stats));
content_copyCOPY