if I had an array of objects such as
const arrOfObj = [
{
'a': 'a',
'b': 'b',
'c': 'c',
'd': 'd'
}
]
how do I create a new array with an object that has only a and b?
{
'a': 'a',
'b': 'b'
}
I've been trying something like
Object.entries(arrOfObjs[0]).filter(x => x[0] !== 'a' && x[0] !== 'b')
but there must be a simpler cleaner way