2 * array-unique <https://github.com/jonschlinkert/array-unique>
4 * Copyright (c) 2014-2015, Jon Schlinkert.
5 * Licensed under the MIT License.
10 module.exports = function unique(arr) {
11 if (!Array.isArray(arr)) {
12 throw new TypeError('array-unique expects an array.');
21 for (; j < arr.length; ++j) {
22 if (arr[i] === arr[j]) {
30 module.exports.immutable = function uniqueImmutable(arr) {
31 if (!Array.isArray(arr)) {
32 throw new TypeError('array-unique expects an array.');
35 var arrLen = arr.length;
36 var newArr = new Array(arrLen);
38 for (var i = 0; i < arrLen; i++) {
42 return module.exports(newArr);