let t = [{ name:"王五", age:28, sex:"man" }, { name:"王yi", age:30, sex:"man" }, { name:"王san", age:5, sex:"man" } ] let newData = t.map(item => { return { templateId: item.name, designList: item.age, sex:item.sex } }) console.log(newData);
结果为:
2024-01-19 08:29:10
let t = [{ name:"王五", age:28, sex:"man" }, { name:"王yi", age:30, sex:"man" }, { name:"王san", age:5, sex:"man" } ] let newData = t.map(item => { return { templateId: item.name, designList: item.age, sex:item.sex } }) console.log(newData);
结果为: