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]
명세
브라우저 호환성
BCD tables only load in the browser