我该如何在这上面使用数组解构。我要买个林特·韦林。
Use array destructuring. [prefer-destructuring]
const block = Object.entries(products).reduce((acc, item) => {
acc[item[0]] = item[1];
return acc;
}, {});
发布于 2019-01-26 09:10:36
将参数列表中的item解构为[key, val]
const block = Object.entries(products).reduce((acc, [key, val]) => {
acc[key] = val;
return acc;
}, {});https://stackoverflow.com/questions/54374763
复制相似问题