function Dictionary(){
this.datastore={};
this.add=add;
this.find=find;
this.remove=remove;
this.showAll=showAll;
}
function add(key,value){
this.datastore[key]=value;
}
function find(key){
return this.datastore[key];
}
function remove(key){
delete this.datastore[key];
}
function showAll(){
console.log(this.datastore)
for(var key in this.datastore){
console.log(key + ' ==> '+this.datastore[key]);
}
}
var pbook=new Dictionary();
pbook.add('mike',"123");
pbook.add('David','456');
pbook.add('Cynthia','789');
pbook.showAll();
pbook.remove('David');
pbook.showAll();