我有一个lodash变量;
var usernames = _.map(data, 'usernames');
生成以下结果;
[
"joebloggs",
"joebloggs",
"simongarfunkel",
"chrispine",
"billgates",
"billgates"
]
我该如何调整lodash语句,以使其仅返回唯一值的数组?例如:
var username = _.map(data, 'usernames').uniq();
uniqBy
吗?_.uniqBy(data, 'username')
- The Reason