1. <script><br /> //利用函数翻转任意数组 reverse翻转<br /> functionreverse (arr) {<br /> varnewArr = [];<br /> for(i = arr.length - 1; i >= 0; i--){<br /> newArr[newArr.length] = arr[i];<br /> }<br /> returnnewArr;<br /> }<br /> console.log(reverse([1,2,3,4,5]));<br /> </script>

    .