A little bit stuck on the following scenario. I have three arrays, and using the arrays would like to create a new object.
var fields = ['firstName', 'lastName', 'email'],
oldVals = ['John', 'Doe', '[email protected]'],
newVals = ['Jo','Do','[email protected]'];
The new object should be as :
{
"firstName": {
"oldValue": "John",
"newValue": "Jo"
},
"lastName": {
"oldValue": "John",
"newValue": "Do"
},
"email": {
"oldValue": "[email protected]",
"newValue": "[email protected]"
}
}
Thanks in advance.