[JS]js中获取字符串型下标的方法

2015-12-31 写技术

获取数组字符串型下标的方法:

var a = [];
a['aa'] = 1;
a['bb'] = 2;
for(var key in a){
   alert(key+':'+a[key]);
}

标签: JS

发表评论:

Powered by anycle 湘ICP备15001973号-1