嗨,我使用以下代码获得loadash结果
var acc = _.map(accounts, i => _.pick(i, 'id', 'number', 'transit'))
并得到结果
{ id: '125658', number: '8143045', transit: '09060' }
我能用以下方式得到结果吗
{ account_id: '125658', account_number: '8143045', account_transit: '09060' }
lodash的奇怪用例。只需使用原生js。
var acc = _.map(accounts, i => ({ account_id: i.id, account_number: i.number, account_transit: i.transit }));