TypedArray 객체의 reverse() 함수는 유형이 지정된 배열의 내용을 반전시킵니다.
구문
구문은 다음과 같습니다.
typedArray.reverse()
예시
<html>
<head>
<title>JavaScript Array every Method</title>
</head>
<body>
<script type="text/javascript">
var typedArray = new Int32Array([11, 5, 13, 4, 15, 3, 17, 2, 19, 8 ]);
document.write("Contents of the typed array: "+typedArray);
document.write("<br>");
var result = typedArray.reverse(Math.sqrt);
document.write("Contents of the reversed array: "+result);
</script>
</body>
</html> 출력
Contents of the typed array: 11,5,13,4,15,3,17,2,19,8 Contents of the reversed array: 8,19,2,17,3,15,4,13,5,11