JavaScript中的TypedArray.reverse()函数
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
热门推荐
3 薛之谦祝福语简短
10 科学老师结婚祝福语简短
11 迎新祝福语简短20字
12 祝福语勤奋大全简短英语
13 儿子31岁祝福语简短
14 简短的高考祝福语精选
15 生日祝福语贺卡老师简短
16 开业祝福语简短大气的
17 给舍友送祝福语简短
18 新老师祝福语 简短独特