数组的定义:
var colors = new Array(20);
var colors = new Array('red'); // ['red']
var colors = ['red'...green', 'black']
var ret = colors.slice(0, 1); //['red'] 切片
colors.splice(pos, length, item, item...); 在pos...function(item, index, array){}); 所有元素返回true则返回true
colors.filter(function(item, index, array){}); 返回为true的元素组成的数组...colors.forEach(function(item, index, array){}); 无返回值
colors.map(function(item, index, array){}); 返回函数调用结果组成的数组...var sum = values.reduce(function(prev, cur, index, array){return prev + cur}, 0);
reduceRight(); 从后往前循环