HTML: Markup language
CSS: Styling language
JavaScript: Scripting language
Web APIs: Programming interfaces
All web technology
Learn web development
Discover our tools
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
View in English Always switch to English
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2016년 9월.
sort() 메서드는 적소에 형식화 배열의 요소를 정렬하여 그 형식화 배열을 반환합니다. 이 메서드는 Array.prototype.sort()와 같은 알고리즘입니다. TypedArray는 여기 형식화 배열 유형 중 하나입니다.
sort()
Array.prototype.sort()
typedarray.sort([compareFunction]);
compareFunction
정렬 순서를 정의하는 함수를 지정합니다.
더 많은 예는, Array.prototype.sort() 메서드도 참조하세요.
var number = new Uint8Array([40, 1, 5, 200]); function compareNumbers(a, b) { return a - b; } numbers.sort(compareNumbers); // Uint8Array [ 1, 5, 40, 200 ]
Enable JavaScript to view this browser compatibility table.