1.使用length清空数组:
<script>
var arr1 = ['aaa','bbbb','//www.qb5200.com'];
alert(arr1);
arr1.length = 0;
alert(arr1); //数组为空
</script>
2.使用length截短数组:
<script>
var arr1 = ['aaa','bbbb','c','d','e'];
arr1.length = 3;
alert(arr1); //截断数组aaa,bbbb,c
</script>