ช่วยหน่อยครับ ข้อ Pass Parameters แบบ Destructuring

บอกเราว่าเกิดอะไรขึ้น:
error ฟ้องว่า “ควรใช้ Destructuring”
แบบนี้ไม่ใช่ Destructuring เหรอครับ
แล้วมันต้องทำไง


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: max,min: min}) => (max + min) / 2.0; 
// Only change code above this line

Challenge: Use Destructuring Assignment to Pass an Object as a Function’s Parameters

ไปสู่ the challenge:

ไม่ต้องมี : ต่อท้ายครับ

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

ได้แล้ว ขอบคุณครับ งงอยู่นานเลย