1. Use length to clear the array:
Copy code code as follows:
<script>
var arr1 = ['aaa', 'bbbb', '// www.vevb.com'];
alert (ARR1);
arr1.Length = 0;
alert (ARR1); // The array is empty
</script>
2. Use length short group:
Copy code code as follows:
<script>
var arr1 = ['aaa', 'bbbb', 'c', 'd', 'e'];
arr1.Length = 3;
alert (ARR1); // Trimch the array AAA, BBBB, C
</script>