uniq
====
Removes all duplicates from an array in place.
Usage
=====
First install using npm:
npm install uniq
Then use it as follows:
```javascript
var arr = [1, 1, 2, 2, 3, 5]
require("uniq")(arr)
console.log(arr)
//Prints:
//
// 1,2,3,5
//
```
## `require("uniq")(array[, compare, sorted])`
Removes all duplicates from a sorted array in place.
* `array` is the array to remove items from
* `compare` is an optional comparison function that returns 0 when two items are equal, and something non-zero when they are different. If unspecified, then the default equals will be used.
* `sorted` if true, then assume array is already sorted
**Returns:** A reference to `array`
**Time Complexity:** `O(array.length * log(arra.length))` or `O(array.length)` if `sorted`
## Why use this instead of underscore.uniq[ue]?
A few reasons:
* This library updates the array in place without making an extra copy (and so it is faster for large arrays)
* It also accepts a custom comparison function so you can remove duplicates from arrays containing object
* It is more modular in the sense that it doesn't come with a bazillion other utility grab bag functions.
# Credits
(c) 2013 Mikola Lysenko. MIT License
没有合适的资源?快使用搜索试试~ 我知道了~
整理综合所学习的前端知识网络.zip
共326个文件
js:137个
html:120个
css:31个
需积分: 5 0 下载量 68 浏览量
2022-11-02
16:09:28
上传
评论
收藏 2.02MB ZIP 举报
温馨提示
整理综合所学习的前端知识网络.zip
资源详情
资源评论
资源推荐
收起资源包目录
整理综合所学习的前端知识网络.zip (326个子文件)
demo.appcache 67B
style.css 2KB
style.css 1KB
style.css 1KB
style.css 1018B
style.css 842B
style.css 625B
style.css 609B
style.css 536B
style.css 526B
style.css 511B
style.css 461B
style.css 433B
style.css 421B
style.css 394B
style.css 382B
style.css 381B
style.css 358B
style.css 344B
style.css 318B
style.css 283B
style.css 260B
style.css 226B
style.css 188B
style.css 173B
style.css 123B
style.css 72B
style.css 47B
style.css 24B
style.css 0B
style.css 0B
style.css 0B
CSS3圆角.drawio 6KB
grid布局参数表.drawio 4KB
圣杯&双飞翼布局.drawio 2KB
CSS3形变&动画.drawio 2KB
img_navsprites.gif 3KB
index.html 7KB
index.html 3KB
初始Vue.html 2KB
index.html 1KB
index.html 1KB
index.html 1KB
模板语法.html 1KB
index.html 1KB
index.html 1KB
index.html 1KB
index.html 986B
index.html 975B
index.html 830B
index.html 784B
index.html 769B
index.html 752B
index.html 741B
index.html 726B
index.html 700B
index.html 681B
indexB.html 667B
index.html 656B
index.html 611B
indexA.html 581B
index.html 545B
index.html 521B
index.html 518B
index.html 473B
index.html 473B
index.html 422B
index.html 412B
index.html 412B
index.html 411B
index.html 409B
index.html 403B
index.html 343B
index.html 341B
index.html 335B
index.html 332B
index.html 332B
index.html 329B
index.html 329B
index.html 329B
index.html 315B
index.html 304B
index.html 302B
index.html 300B
index.html 294B
index.html 292B
index.html 289B
index.html 288B
index.html 288B
index.html 275B
index.html 275B
index.html 275B
index.html 269B
index.html 263B
index.html 258B
index.html 248B
index.html 248B
index.html 245B
index.html 245B
index.html 245B
共 326 条
- 1
- 2
- 3
- 4
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6804
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0