LOADASH PICK Właściwość z obiektu według innej nazwy
var arr = [
{"id":1,"name":"Name1","status":"active","account_id":"2KGGALS2353255"},
{"id":2,"name":"Name2","status":"active","account_id":"4ABCLS2353255"},
{"id":3,"name":"Name3","status":"active","account_id":"6LMNALS2353255"}
];
var result = arr.map(function(obj) {
return {
core: _.pick(obj, ['id', 'name']),
extra: _.omit(obj, ['id', 'name'])
};
});
console.log(result);
Dull Dogfish