有点卡在以下情况。 我有三个数组,并使用数组想要创建一个新的对象。从三个阵列创建对象
var fields = ['firstName', 'lastName', 'email'],
oldVals = ['John', 'Doe', '[email protected]'],
newVals = ['Jo','Do','[email protected]'];
新的对象应该是为:提前
{
"firstName": {
"oldValue": "John",
"newValue": "Jo"
},
"lastName": {
"oldValue": "John",
"newValue": "Do"
},
"email": {
"oldValue": "[email protected]",
"newValue": "[email protected]"
}
}
感谢。
你问一个函数会将这些数组转换成一个对象? – juil
这是什么部分你坚持?你到底做了什么来解决这个问题? –
Doe发生了什么事? –