数组相关操作

1. 将数据对象重组成需要的数组

  

 const obj = {
        fileId: '2022091247189020160833,2022091247189166178204',
        fileName: 'logo-axa.png,1.zhimg.jpg',
        time: '2022-09-08 13:20:00',
        postalCode: '12345678',
        policyHolderAddress: '上海市上海市浦东新区',
        owner: 'admin',
        success: '1',
      }
      const a = obj.fileId.split(',').map((val, item) => {
        return Object.assign({}, { fileId: val, fileName: obj.fileName.split(',')[item] })
      })
      console.log(a)

 

posted @ 2022-09-08 17:24  宫圆薰  阅读(12)  评论(0编辑  收藏  举报