reverse() 메서드는 제자리에서 형식화 배열을 뒤집습니다. 형식화 배열 첫 요소는 마지막이 되고 마지막은 첫 요소가 됩니다. 이 메서드는 Array.prototype.reverse()와 같은 알고리즘입니다. TypedArray는 여기 TypedArray 객체 유형 중 하나입니다.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
구문
typedarray.reverse();
반환 값
뒤집힌 배열.
예제
var uint8 = new Uint8Array([1, 2, 3]); uint8.reverse(); console.log(uint8); // Uint8Array [3, 2, 1]
명세
브라우저 호환성
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
reverse | Chrome Full support 45 | Edge Full support 14 | Firefox Full support 37 | IE No support No | Opera Full support 32 | Safari Full support 10 | WebView Android Full support 45 | Chrome Android Full support 45 | Firefox Android Full support 37 | Opera Android No support No | Safari iOS Full support 10 | Samsung Internet Android Full support Yes | nodejs Full support 4.0.0 |
Legend
- Full support
- Full support
- No support
- No support