Tell us what’s happening:
How does the program know that max and min are from the stats object? What if there was another object with max and min properties?
Your code so far
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 = ({max, min}) => (max + min) / 2;
// Only change code above this line
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36.
Challenge: Use Destructuring Assignment to Pass an Object as a Function’s Parameters
Sorry I was Totally wrong
please disregard these ramlings
it does not and you have not passed an object to any thing
this is an error
({max, min}) => (max + min) / 2;
and even if it was correctly written
min and max would still be undefined
objects are written more like this …
{key:value}
Sorry I was Totally wrong
please disregard these ramlings