Array 类型
初始化:
var colors = new Array();
var colors = new Array("red", "blue", "green");
检测数组
if (value instanceof Array)
{
}
ES5:
if (Array.isArray(value))
{
}
转换方法
toLocaleString(), toString(), valueOf(), join(): join(",")/ join(";"), join("||")
栈方法
var colors = new Array();
var count = colors.push("red");
var item = colors.pop(); // 取得最后一项
队列方法
var colors = new Array();
var count = colors.push("red");
var item = colors.shift(); // 取得第一项
重排序方法
reverse(), sort().
values = {2, 3, 10};
values.sort(compare);
操作方法
var colors = new Array();
colors.splice(): 算是最强大的数组方法。删除,插入,替换。
colors.indexof(): 位置方法
迭代方法
every()
filter()
forEach()
map()
some()
缩小方法
reduce()
reduceRight()