Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var arr = [11,22,334,44,55,66];
var store = [];
var result = arr.slice(0).every(function(item, index, array){
  if(store.indexOf(item) > -1){
    array.length=0;
    return false;
  }else{
    store.push(item);
    return true;
  }
});
console.log(result);
Array.prototype.isUnique = function() {
    var uniq = [];
    var result = this.slice(0).every(function(item, index, arr) {
        if (uniq.indexOf(item) > -1) {
            arr.length = 0;
            return false;
        } else {
            uniq.push(item);
            return true;
        }
    });
    return result;
};
console.log(arr.isUnique());
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
prabhuignotopro
0viewers