Destructure an array parameter [duplicate]
问题 This question already has an answer here : Syntax for destructuring arrays into function parameters in ES6 (1 answer) Closed 1 year ago . Is it possible to destructure a function parameter? For example, I would want to convert this: Object.entries({}).find(group=> group[0] === "foo" && group[1] === "bar"); To something like this: Object.entries({}).find([0: key, 1: value] => key === "foo" && value === "bar"); or Object.entries({}).find([...key, value] => key === "foo" && value === "bar"); 回答1