I have an array of objects
const data = [{id:1, a:false, b:[5,4]},
{id:2, a:true, b:[]},
{id:3, c:'', d:{}},
{id:4, e:[1,2,3], f:{h: 1}}];
basically I am trying to return an object that has all the properties found in the object, and then give me the latest value.
so it should give me the following result:
// { id: 4, a: false, b: [], c: '', d: {}, e: [1,2,3], f: {h: 1}}
I played around with Object.getOwnPropertyNames and Object.values, but been stuck for some time now , fairly new to JS.
a:truesince it is present in the second object.