我可以在 Javascript 箭头函数中解构数组吗?

Jos*_*sen -1 javascript destructuring arrow-functions

任何版本的 Javascript 是否支持箭头函数中数组的解构?例如

const items = [ [1, 2], [3, 4] ];
const sums = items.map( [a, b] => a + b );
Run Code Online (Sandbox Code Playgroud)

Cer*_*nce 5

可以,但必须将参数括在括号中:

const items = [ [1, 2], [3, 4] ];
const sums = items.map(([a, b]) => a + b );
console.log(sums);
Run Code Online (Sandbox Code Playgroud)