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', 'doe@mail.com'],
newVals = ['Jo','Do','jo@mail.com'];
The new object should be as :
{
"firstName": {
"oldValue": "John",
"newValue": "Jo"
},
"lastName": {
"oldValue": "John",
"newValue": "Do"
},
"email": {
"oldValue": "doe@mail.com",
"newValue": "jo@mail.com"
}
}
Thanks in advance.
See Question&Answers more detail:os