function mySet (){
var collection = [];
this.has = function(element){
return (collection.indexOf(element) != -1);
}
this.value = function(){
return collection;
}
this.add = function(element){
if (!this.has(element)){
collection.push(element);
}
return false;
}
this.remove = function(element){
if(collection.indexOf(element) == -1){
return false;
}
else{
collection.splice(element,1);
}
}
}
var myset = new mySet();
myset.add(1);
myset.add(2);
myset.remove(0);
console.log(myset.value());