I have an array with names in.
I also have an object with keys that are the same as those in the array. The object also has other keys.
I would like to copy the object but only include the keys that are in the array
const keys = ['one', 'two', 'three'];
const obj = {
date: 'Jan',
color: 'Red',
one: 367,
two: 427,
three: 753
}
const objCopy = Object.assign({}, obj)
// I'd like this console to display
// {
// "one": 367,
// "two": 427,
// "three": 753
// }
console.log(objCopy)