标签:
<!--
Array对象
常用方法
concat():合并数组
sort():排序
push():末尾追加元素
reverse():数组元素翻转
-->
<script>
// var a=["hello","world"];
// var b =["ze","feng"];
// var c=a.concat(b);
// document.write(c);
//
// var d=["e","a","s","b"];
//// document.write(d.sort());
// document.write(d.reverse());
var e=["0","5","8","1","5","3"];
document.write(e.sort(function(a,b){
return b-a;//降序
}));
var a=["a","b"];
a.push("c");
document.write(a);
</script>
标签:
原文地址:http://www.cnblogs.com/xiezefeng/p/4516065.html