- 首先它支持多数据存储,具有增删查功能
- set()设置
- get()获取;
- has()查找;
- delete('obj')删除指定;clear()全部删除
- size长度
let json={ name:"websong",skili:"web" }; //设置-增加 var msp=new Map(); msp.set(json,'iam'); console.info(msp) msp.set('niubi','111') console.info(msp)
//取值get console.log(msp.get(json)) console.log(msp.get('niubi'))
//删除指定值delete,全部删除clert console.log(msp.delete(json)) console.log(msp); msp.clear() console.log(msp)
console.log(msp.size)//长度 console.log(msp.has(json))//查找返回结果为布尔值