TypedArray.prototype.reverse()
TypedArray
实例的 reverse()
方法反转类型化数组 到位 并返回对同一类型化数组的引用,第一个类型化数组元素现在成为最后一个,最后一个类型化数组元素成为第一个。换句话说,类型化数组中的元素顺序将转向与前面所述相反的方向。该方法与 Array.prototype.reverse()
的算法相同。
¥The reverse()
method of TypedArray
instances reverses a typed array in place and returns the reference to the same typed array, the first typed array element now becoming the last, and the last typed array element becoming the first. In other words, elements order in the typed array will be turned towards the direction opposite to that previously stated. This method has the same algorithm as Array.prototype.reverse()
.
Try it
语法
参数
返回值
描述
¥Description
详细信息请参见 Array.prototype.reverse()
。此方法不是通用的,只能在类型化数组实例上调用。
¥See Array.prototype.reverse()
for more details. This method is not generic and can only be called on typed array instances.
示例
使用反向()
规范
Specification |
---|
ECMAScript Language Specification # sec-%typedarray%.prototype.reverse |
浏览器兼容性
BCD tables only load in the browser