function dictionary(){
this.datastore = new Array()
this.add = add
this.find = find
this.remove = remove
this.showAll = showAll
}
function add (key, value) {
this.datastore[key] = value
}
function remove (key) {
delete this.datastore[key]
}
function find (key) {
return this.datastore[key]
}
function showAll () {
for (var key in this.datastore){
console.log(this.datastore[key])
}
}
console.log(111)
var dic = new dictionary()
dic.add('name', 'cy')
dic.add('address', 'beijing')
dic.add('age', '24')
dic.showAll()
console.log('findName: ' + dic.find('name'))
dic.remove('name')
dic.showAll()
console