const keys = ['addr', 'name', 'status']
const arr = [
{
addr: "vrn"
name: null
id: 2
num: "1"
status: false
}
]
[
{
addr: "vrn"
name: null
status: false
}
]
const pick = (obj, keys) => Object.fromEntries(keys.map(k => [ k, obj[k] ]));
const newArr = arr.map(n => pick(n, keys));
const pick = (obj, keys) =>
Object.fromEntries(Object.entries(obj).filter(m => keys.includes(m[0])));
// или
const pick = (obj, keys) =>
keys.reduce((acc, n) => (obj.hasOwnProperty(n) && (acc[n] = obj[n]), acc), {});