赞
踩
var a, b;
a = [0,1,2,3,4];
b = a.join("-"); //"0-1-2-3-4"
var str = "aaa,bbb,ccc";
strArr = str.split(",");// 在每个逗号(,)处进行分解 ["aaa", "bbb", "ccc"]
var hello = "helloworld";
helloArr = hello.split(''); //["h", "e", "l", "l", "o", "w", "o", "r", "l", "d"]
let day = [1,2,4,5]
day.slice(0, -1) // [1, 2, 4] 去掉了最后一个
let array = [1, 2, 3]
array.splice(index, 1) //index是下标,1是长度 array.splice(1, 1) 就得到[1,3]!!!!!!!!!!!!!!!对原数组进行了修改
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。