Underscore.js - get unique property values

后端 未结 5 1985
我寻月下人不归
我寻月下人不归 2021-02-13 18:12

I only recently discovered the power of underscore.js, still new to the methods I kindly ask for a suggestion:

How do I get from this:

[
    [{
                 


        
5条回答
  •  长发绾君心
    2021-02-13 18:37

    _.uniq(_.pluck(x,'name'));
    

    the above code is sufficient for extracting different "name" attribute

提交回复
热议问题