** I’m sorry if this question is kinda stupid and the english is bad,**
Below is the right answer for the challenge, my question is , when i put curly braces in code body, it return undefined, can someone explain it to me? thank you
const half = ({max,min})=>{
max + min / 2.0;
}
console.log(half(stats)); // return undefined
The right answer
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.0;
// Only change code above this line
console.log(half(stats));
Challenge: Use Destructuring Assignment to Pass an Object as a Function’s Parameters
Link to the challenge: