TypedArray.reverse() 函数在 JavaScript 中
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
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP