Pull only certain properties from each object in an array, and add to new array
问题 Attempting to learn javascript. I am trying to create Table Row data from data in state (being sent to components via Context API): myArr = [ {id: 1, name: AA, desc: DescA, color: red}, {id: 2, name: BB, desc: DescB, color: orange}, {id: 3, name: CC, desc: DescC, color: green}, {id: 4, name: DD, desc: DescD, color: blue}, ] I would like to pull only name and color from each object, and create a new arr of objects. newArr = [ {name: AA, color: red} {name: BB, color: orange} {name: CC, color: