vararr=["车主姓名","车主电话","报价时间","车型","VIN","车牌号","报价单位","报价人","联系人"]varobj=[{type:'none',ul:['车主姓名','车主电话','报价时间']},{type:'none',ul:['车型','VIN','车牌号']},{type:'none',ul:['报价单位','报价人','联系人']}]把arr变成obj
2 回答
holdtom
TA贡献1805条经验 获得超10个赞
供参考arr.reduce((r,x,i)=>i%3==0?[...r,{type:'none',ul:arr.slice(i,i+3)}]:r,[])
添加回答
举报
0/150
提交
取消