//js模拟map Map = { obj : {}, put : function(key , value){ this.obj[key] = value; }, get : function(key){ return this.obj[key]; }, eachMap : function(fn){ for(var arr in this.obj){ fn(arr,this.obj[arr]); } } }; var map = Map; //利用js对象的key,value的唯一性特性实现…