I have an array here:
var array = [
[
['firstName', 'Nork'], ['lastName', 'James'], ['age', 22], ['position', 'writer']
],
[
['firstName', 'James'], ['lastName', 'Rodel'], ['age', 25], ['position', 'programmer']
]
];
I created a function that will transform my function into obj array like this:
[
{firstName: 'Nork', lastName: 'James', age: 22, position: 'writer'},
{firstName: 'James', lastName: 'Rodel', age: 25, role: 'programmer'}
]
So I created a function to do that. However I am not sure where to start to enable me to merge them.
function changeData(array) {
var obj = { };
}
changeData(array);
Any help?