js常用操作

map操作:
var map = {};
map["a"] = 1;
map["b"] = 2;

console.log(Object.keys(map)); //[ 'a', 'b' ]
console.log(map); //{ a: 1, b: 2 }
delete map["a"];

 

遍历map

for(var key in $scope.idsMap){
$scope.kpIds.push($scope.idsMap[key]);
}
posted @ 2019-04-08 20:33  Andrew_F  阅读(126)  评论(0编辑  收藏  举报