【发布时间】:2019-04-17 21:18:26
【问题描述】:
如果我有以下 ES6 方法:
function myClothes([first, second, third]) {
return {
first: first,
second: second,
third: third
}
}
如何在控制台窗口中打印出“运动鞋裤子衬衫”?我尝试了以下方法,但仍然没有解决方案:
console.log(myClothes({
['first']:'sneakers',
['second']:'pants',
['third']:'shirt'
}));
我做错了什么?
非常感谢!
【问题讨论】:
标签: javascript arrays function object ecmascript-6