[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort [Back]  [Original]

TypedArray.prototype.sort() - JavaScript | MDN

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

TypedArray.prototype.sort()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2016 9.

sort() . Array.prototype.sort() . TypedArray .

In this article

js
typedarray.sort([compareFunction]);

compareFunction Optional

.

, Array.prototype.sort() .

js
var number = new Uint8Array([40, 1, 5, 200]);

function compareNumbers(a, b) {
  return a - b;
}

numbers.sort(compareNumbers);
// Uint8Array [ 1, 5, 40, 200 ]

Specification
ECMAScript 2027 LanguageSpecification
# sec-%typedarray%.prototype.sort


Web Proxy Viewer  |  New URL  |  Original Page