1、forEach遍歷:
map.forEach(function(value,key){
console.log(value,key);
});
函數中第一個參數是屬性值,第二個參數是屬性
2、for-of遍歷:
①for(let item of map){
}
遍歷結果是數組
②for(let item of map.values()){
}
遍歷屬性值
③for(let item of map.keys()){
}
遍歷屬性
3、entries遍歷:
for(let item of map.entries()){
}
遍歷結果同forEach