记录将数组转成对象方法 let array = [1,2,3,4,5]; let obj ={}; obj = Object.assign({}, array) console.log(obj); // {1,2,3,4,5}