js 实现map

//map的JS实现
	this.map = function(){
		var map = {
			put: 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 map;
	}

你可能感兴趣的:(js 实现map)