摘要: 请选择地区: 阅读全文
posted @ 2018-12-26 21:39 小金king 阅读(286) 评论(0) 推荐(0) 编辑
摘要: /* 遍历数组 */ var arr=[1,2,3,43,55,66,77,99]; /* 遍历数组 function(item,index) */ arr.forEach(function(item,index){ console.log(item,"forEach"); // }); var... 阅读全文
posted @ 2018-12-26 21:32 小金king 阅读(1514) 评论(0) 推荐(0) 编辑
摘要: 数组的增加方法 1.push()方法向数组中末尾添加一个元素,原数组改变 2.unshit()方法向数组中开始元素添加一个元素,原数组改变 3.splice()方法 ary.splice(n,m,x) 从索引n开始删除m个元素,把新增的元素X放在索引n的前面,把删除的元素当成一个新数组返回,原有数组 阅读全文
posted @ 2018-12-26 14:40 小金king 阅读(567) 评论(0) 推荐(0) 编辑