数据类型转换
string - int
var day = parseInt(120900 / (1000 * 60));
int- string
var days = day.toString();
https://blog.csdn.net/shanshan_1117/article/details/89371296
二。数据使用
https://www.jianshu.com/p/185efaea230c
数组复制
let arr = [];
arr[0] = "a";
arr[3] = "b";
this.data.listLoad = arr.slice();
数组遍历
let arr = [];
arr[0] = "a";
arr[3] = "b";
arr[10] = "c";
arr[6] = "Hello world";
arr.forEach((data, index, array) => {
console.log(data, index);
});
数组删除元素
let arr = [];
arr[0] = "a";
arr[1] = "b";
arr[2] = "c";
arr[3] = "Hello world";
arr.splice(1, 2)//删除下标为1的2个数
console.log('-=-=-=-=-=-=='+arr);
网友评论