首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

typedArray.reverse

reverse()方法原地翻转类型化数组。类型化数组的第一个元素变为最后一个,最后一个变为第一个。这个方法的算法和Array.prototype.reverse()相同。TypedArray是这里的类型化数组类型之一。

语法

代码语言:javascript
复制
typedarray.reverse();

返回值

翻转的数组。

示例

代码语言:javascript
复制
var uint8 = new Uint8Array([1, 2, 3]);
uint8.reverse();

console.log(uint8); // Uint8Array [3, 2, 1]

规范

Specification

Status

Comment

ECMAScript 2015 (6th Edition, ECMA-262)The definition of 'TypedArray.prototype.reverse' in that specification.

Standard

Initial definition.

ECMAScript 2017 Draft (ECMA-262)The definition of 'TypedArray.prototype.reverse' in that specification.

Draft

?

浏览器兼容性

Feature

Chrome

Edge

Firefox (Gecko)

Internet Explorer

Opera

Safari

Basic support

45

12

37 (37)

No support

32

10

Feature

Android

Chrome for Android

Firefox Mobile (Gecko)

IE Mobile

Opera Mobile

Safari Mobile

Basic support

No support

No support

37 (37)

No support

No support

10

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com