这样的数组如何遍历数据?

小程序 文章 2020-08-11 14:41 176 0 全屏看文

这样的数组如何遍历数据?How to traverse data in such an array?

这样的数组如何遍历数据?
【原数组】data: Array(5)0: ["ID""姓名""电话""地址""邮箱""工号"],1: ["1""小王""11111""北京""11111@qq.com""g1"],2: ["2""小李""22222""北京""22222@qq.com""g2"],3: ["3""小赵""33333""北京""33333@qq.com""g3"],4: ["4""小张""44444""北京""44444@qq.com""g4"]


【如何遍历成以下的新数组】data: Array(5)0: ["ID":1,"姓名":"小王""电话":"11111""地址":"北京""邮箱":"11111@qq.com""工号":"g1"],1: ["ID":2,"姓名":"小李""电话":"22222""地址":"北京""邮箱":"22222@qq.com""工号":"g2"],2: ["ID":3,"姓名":"小赵""电话":"33333""地址":"北京""邮箱":"33333@qq.com""工号":"g3"],3: ["ID":4,"姓名":"小张""电话":"44444""地址":"北京""邮箱":"44444@qq.com""工号":"g4"],


[original array] data: array (5) 0: ["Id", "name", "telephone", "address", "email", "job number"], 1: [1 "," Xiaowang "," 11111 "," Beijing "“ 11111@qq.com "," G1 "], 2: [2", "Xiao Li", "22222", "Beijing" 22222@qq.com "," G2 "], 3: [3", "Xiaozhao", "33333", "Beijing" 33333@qq.com "," G3 "], 4: [4", "Xiaozhang", "44444", "Beijing", " 44444@qq.com Data: array (5) 0: ["Id": 1, "name": "Xiao Wang", "Tel.:" 11111 "," address ":" Beijing "," email ":" 11111@qq.com Job No.: G1], 1: ["Id": 2, name: Xiao Li, Tel: 22222, address: Beijing, email: 22222@qq.com "," job No.: "G2"], 2: [ID ": 3," name ":" Xiao Zhao ", "Tel.": "33333", "address": "Beijing", "e-mail":“ 33333@qq.com Job No.: G3], 3: ["Id": 4, name: Xiaozhang, Tel.: 4444444, address: Beijing, email: 44444@qq.com "," job No.: "G4"],

回答:

?:

可以直接贴你接口请求返回的列表吗?

undefined:

新数组的元素应该是对象才对吧:

{"ID":1,"姓名":"小王""电话":"11111""地址":"北京""邮箱":"11111@qq.com""工号":"g1"}


桐洛雨:如何遍历啊?
undefined:

-EOF-