Js键值对类型
声明:
var points= {};
存:
points.a='123';
points.b ='456';
var p1 = 'c';
points[p1]='789';
结果points= {'a':'123','b':'456','c':'789'};
取:
var d = points['a']; //则d的值就是‘123’
删除:
delete(points['a']);
循环取值:
for(var i in points) { alert(points[i]); }
长风破浪会有时,直挂云帆济沧海!
可通过下方链接找到博主
https://www.cnblogs.com/judes/p/10875138.html