Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2023年7月.
toSorted() は TypedArray インスタンスのメソッドで、 sort() メソッドのコピーメソッド版です。これは、要素を昇順にソートした新しい型付き配列を返します。このメソッドは Array.prototype.toSorted() と同じアルゴリズムですが、既定で文字列としてではなく数値として値をソートする点が異なります。
要素の順序を決定する関数。省略された場合、型付き配列の要素は値に基づいてソートされます。詳しくは sort() を参照してください。
要素を昇順にソートした新しい型付き配列です。
詳細については、 Array.prototype.toSorted() をご覧ください。このメソッドは汎用的ではなく、型付き配列インスタンスに対してのみ呼び出すことができます。
その他の例については、 Array.prototype.sort() メソッドもご覧ください。
| ECMAScript® 2027 Language Specification # sec-%typedarray%.prototype.tosorted |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2026年1月22日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.