value instanceof Array
Array.isArray()
toLocaleString();
toString();
valueOf();
join();
push();
pop();
shift();
unshift();
reverse();
sort();
concat();//基于当前数组中的所有项创建一个新数组
slice();//基于当前数组中的一或多个项创建一个新数组,类似于切片操作
var colors = ["red","green","blue","yellow","purple"]
var colors1 = colors.slice(1);
var colors2 = colors.slice(1,4);
colors1; //["green", "blue", "yellow", "purple"]
colors2; //["green", "blue", "yellow"]
splice();//删除数组中的项,向数组中部插入项
//删除:splice(0,2),需要删除的第一项的位置和要删除的项数
//插入:splice(0,2,"red","green"),从当前数组的位置2开始插入字符串"red","green"
//替换:splice(2,1,"red","green")会删除当前数组位置2的项,然后从位置2开始插入字符串"red","green"
indexOf();
lastIndexOf();
every();//对数组中的每一项运行给定函数,如果该函数对每一项都返回true,则返回true
filter();//对数组中的每一项运行给定函数,返回该函数会返回true的项组成的数组
forEach();//对数组中的每一项运行给定函数,这个方法没有返回值
map();//对数组中的每一项运行给定函数,返回每次函数调用的结果组成的数组
some();//对数组中的每一项运行给定函数,如果该函数对任一项返回true,则返回true
reduce();
reduceRight();
var values = [1,2,3,4,5]
var sum = values.reduce(function(prev,cur,index,array));
var sum1 = values.reduceRight(function(prev,cur,index,array));
sum;
sum1;
[1,2,3].forEach((value , index) => console.log(value));
arr = [1,2,3].map(v => v * 2);
[1,2,3,4].every(v => v > 3);
[1,2,3,4].some(v => v > 3);
[1,2,3,4,5].filter(v => v > 3);
[1,2,3].indexOf(2);
arr1 = [1 , 2 , 3];
arr2 = [4 , 5 , 6];
[...arr1 , ...arr2];
arr = [1,2,3,4,5,4,3,2,1];
[...new Set(arr)];