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

后端 未结 7 1161
小蘑菇
小蘑菇 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:45

    That one linear might save some lines:

    var results=_.pick(_.where(people, {city : "ny"}), 'firstName', 'qty');
    

提交回复
热议问题