<html>
<head>
</head>
<script type="text/javascript">
//数组
var stuName1 = new Array();
stuName1[1] = "小强1";
stuName1[2] = "小强2";
//alert(stuName.length);
//声明并穷举数组
var stuName2 = new Array("小强3","小强4");
//alert(stuName2.length);
var stuName3 = ["小强5","小强6"];
alert(stuName3.length);
alert(stuName1.concat(stuName2).length);
var stuStr = stuName1.join("#");
alert(stuStr);
alert(stuName3.pop());
alert(stuName3.shift());
alert(stuName3.push("小强强"));
alert(stuName3.unshift("强哥"));
stuName1.reverse();
var stuStr = stuName1.join("#");
alert(stuStr);
alert(stuName2.slice(1));
var number = [1, 3, 2];
alert(number.sort());
</script>
<body>
</body>
</html>
</html>
注:
1、如果想按升序排列的话用sort 如果想降序的话使用sort后使用reverse