{
this._hash=newObject();
this.add=function(key,value){
if(typeof(key)!="undefined"){
if(this.contains(key)==false){
this._hash[key]=typeof(value)=="undefined"?null:value;
returntrue;
}else{
returnfalse;
}
}else{
returnfalse;
}
}
this.remove=function(key){deletethis._hash[key];}
this.count=function(){vari=0;for(varkinthis._hash){i++;}returni;}
this.items=function(key){returnthis._hash[key];}
this.contains=function(key){returntypeof(this._hash[key])!="undefined";}
this.clear=function(){for(varkinthis._hash){deletethis._hash[k];}}
}
vara=newHashtable();
a.add("aa");
a.add("bb",2342);
a.add("bb",2342);
a.remove("aa");
alert(a.count());
alert(a.contains("bb"));
alert(a.contains("aa"));
alert(a.items("bb"));