At underscore js, Can I get multiple columns with pluck method after input where method as linq select projection

后端 未结 7 1230
小蘑菇
小蘑菇 2021-01-30 12:59
var people = [
    {firstName : \"Thein\", city : \"ny\", qty : 5},
    {firstName : \"Michael\", city : \"ny\", qty : 3},
    {firstName : \"Bloom\", city : \"nj\", qty         


        
7条回答
  •  时光取名叫无心
    2021-01-30 13:48

    We don't have to use pluck, omit do the trick as well.

    var result = _.map(people, function(person) {
      return _.omit(person, 'city');
    });
    

提交回复
热议问题