首页 > 代码库 > JavaScript 实现Map

JavaScript 实现Map

var map=new Map();

map.put("a","A");map.put("b","B");map.put("c","C");

map.get("a"); //返回:A

map.entrySet() // 返回Entity[{key,value},{key,value}]
map.containsKey(‘kevin‘) //返回:false

function Map() {
    this.keys = new Array();
    this.data = http://www.mamicode.com/new Object();>