数组的定义:
var colors = new Array(20);
var colors = new Array('red'); // ['red']
var colors = ['red'..., 'green'];
判断变量是不是数组:
colors instanceof Array; //true
Array.isArray(colors); //true
将数组转化为字符串:...yellow"
栈方法
colors.push('yellow'); //['red', 'green', 'yellow']
colors.pop(); //['red', 'green']
队列方法...green', 'black']
var ret = colors.slice(0, 1); //['red'] 切片
colors.splice(pos, length, item, item...); 在pos...item, index, array){}); 所有元素返回true则返回true
colors.filter(function(item, index, array){}); 返回为true的元素组成的数组