Underscore: remove all key/value pairs from an array of object

You can use map and omit in conjunction to exclude specific properties, like this:

var newArr = _.map(arr, function(o) { return _.omit(o, 'c'); });

Or map and pick to only include specific properties, like this:

var newArr = _.map(arr, function(o) { return _.pick(o, 'q'); });

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)