Assuming we have the following array structure of n
length:
const sourceArray = [
{ "dynamicKey1": true },
{ "dynamicKey2": false },
{ "dynamicKey3": true },
...
]
How could I tersely reduce this array to a single object of dynamic length:
const convertedObj = {
"dynamicKey1": true,
"dynamicKey2": false,
"dynamicKey3": true
...
}
Thanks!