lodash

来源:互联网 发布:网络信息抓取软件 合法 编辑:程序博客网 时间:2024/06/07 13:06


_uniq ()

_.uniq([2, 1, 2]);// => [2, 1]// using `isSorted`_.uniq([1, 1, 2], true);// => [1, 2]// using an iteratee function_.uniq([1, 2.5, 1.5, 2], function(n) {  return this.floor(n);}, Math);// => [1, 2.5]// using the `_.property` callback shorthand_.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');// => [{ 'x': 1 }, { 'x': 2 }]

0 0
原创粉丝点击