// Return a new Array of unique items.
// IMPORTANT: duplicates are removed starting from begining of array.

var filter = require('./filter')

function unique (arr, compare) {
  compare = compare || isEqual

  return filter(arr, function (item, i, arr) {
    var len = arr.length

    while (++i < len) {
      if (compare(item, arr[i])) return false
    }

    return true
  })
}

function isEqual (a, b) {
  return a === b
}

module.exports = unique

@@ -157,16 +157,18 @@
 que (arr
+ay
 , compar
@@ -202,16 +202,41 @@
  isEqual
+%0A  var len = array.length
 %0A%0A  retu
@@ -248,16 +248,18 @@
 lter(arr
+ay
 , functi
@@ -282,34 +282,8 @@
 ) %7B%0A
-    var len = arr.length%0A%0A
     

update array/unique -- lint