a={}//新建字典
Object {}
a['name']='green';//添加
"green"
delete a['name'];//删除指定元素
true
a
Object {}
a=[]//新建数组
a.push('eeg','kk','oo');//添加
3
a
["eeg", "kk", "oo"]
a.splice(0,1)//删除0位置元素
["eeg"]
a
["kk", "oo"]
a.splice(0,1,"ll")//替换0位置元素
["kk"]
a
["ll", "oo"]
JS随录-2
最新推荐文章于 2023-07-09 21:42:35 发布