method input: (['name', 'marcus'], ['address', 'New York']
method output: {name: marcus, address: New York}
How do i do it?
cont array = [['c','2'],['d','4']];
function objectify()
{
array.forEach(arrayElement => { for(let i = 0; i<2; i++){
const obj = Object.assign({array[i][i]}, array[i++])
}
return obj;
})
}
console.log(objectify);