js多层数组如何转换?
原数组:
arr1 = [
{
checked:false,
fileList:[
{
author: "ad",
fileName: "工作的通知(1) - 副本.docx",
isArchive: "yes",
version: "1"
},
{
author: "ad2",
fileName: "工作的通知(1) - 副本.docx",
isArchive: "yes",
version: "2"
},
{
author: "ad3",
fileName: "工作的通知(1) - 副本.docx",
isArchive: "yes",
version: "3"
},
]
},
{
checked:false,
fileList:[
{
author: "cj",
fileName: "工作的通知(2) - 副本.docx",
isArchive: "yes",
version: "1"
},
{
author: "cj2",
fileName: "工作的通知(2) - 副本.docx",
isArchive: "yes",
version: "2"
},
]
}
]
前端想将原数组转换成这种:
arr2= [
{
checked:false,
author: "ad",
fileName: "工作的通知(1) - 副本.docx",
isArchive: "yes",
version: "1"
},
{
checked:false,
author: "ad2",
fileName: "工作的通知(1) - 副本.docx",
isArchive: "yes",
version: "2"
},
{
checked:false,
author: "ad3",
fileName: "工作的通知(1) - 副本.docx",
isArchive: "yes",
version: "3"
},
{
checked:false,
author: "cj",
fileName: "工作的通知(2) - 副本.docx",
isArchive: "yes",
version: "1"
},
{
checked:false,
author: "cj2",
fileName: "工作的通知(2) - 副本.docx",
isArchive: "yes",
version: "2"
},
]
请问使用js方法如何转换啊?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)