JavaScript Array(数组)对象

Araay对象用于在单个的变量中存储多个值


Araay对象的语法

new Array();

new Arraylength);length代表字段的长度

new Arraylist); list代表参数列表


Araay的方法

concat(); 连接两个或更多的数组,并返回结果

pop(); 删除并返回数组的最后一个元素

push(); 向数组的末尾添加一个元素

unshift(); 向数组的开头添加一个元素

reverse();  将数组的顺序倒过来

shift(); 删除数组的第一个元素

sort(); 对数组进行排序



猜你喜欢

转载自blog.csdn.net/qq_39097722/article/details/80734367