function HashMap(){ var hashMap = { Set : function(key,value){ this[key] = value}, Get : function(key){ return this[key]}, Contains : function(key){ return this.Get(key) == null?false:true}, Remove : function(key){ delete this[key]} } return hashMap;}
调用
var hashMap_bengzhan = new HashMap();hashMap_bengzhan.Set("NM","名称");hashMap_bengzhan.Set("TM","时间");