您可以为此使用下划线:
//by size:var uSize = _.uniqBy(arrayWithDuplicates, function(p){ return p.size; });//by custom.price;var uPrice = _.uniqBy(arrayWithDuplicates, function(p){ return p.custom.price; });
您可以为此使用下划线:
//by size:var uSize = _.uniqBy(arrayWithDuplicates, function(p){ return p.size; });//by custom.price;var uPrice = _.uniqBy(arrayWithDuplicates, function(p){ return p.custom.price; });