- 博客(1)
- 收藏
- 关注
原创 数组和字符串的常用方法
数组和字符串的常用方法 数组常用方法 push方法:给数组的末尾添加一项,可以添加多项,返回值是改变后的数组的长度l;改变了原有数组; 例如: let ary = [1,2,3] let res = ary.push(4,5,6) console.log(res) //输出6 unshift 方法: 给数组的头部添加 一项 ,可以添加多项,返回值是改变后的数组的长度;改变了原有数组; 例如: let ary = [1,2,3] let res = ary.unshift(1,2,3) console.l
2020-12-21 11:53:11 269
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人