微信里点“发现”,扫一下
二维码便可将本文分享至朋友圈。
Array<Object> 转Object嘛。
// arr就是数组var obj = {}; arr.forEach((item, i)=>{obj[item.id] = item;});
谢谢了
@霸气小女孩: :)