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-18 11:42:04
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);
结果为: