Tell us what’s happening:
I’ve passed the situation with my code that is down below, but then I’ve changed it to the new values that I’ve assigned to each variable inside the Object and provides me with NaN.
I don’t understand why.
So I think I’ve passed with a bit of luck perhaps, because this seems way odd for me to understand why it didn’t worked out.
Attached I’ve got two print screens of the situation.
**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 {max : maxValue, min: minValue} = stats;
const half = ({ max, min }) => {
return (max + min)/2.0
}
// Only change code above this line
console.log(half(stats))
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Challenge: Use Destructuring Assignment to Pass an Object as a Function’s Parameters
Link to the challenge: