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月.
with() は TypedArray インスタンスのメソッドで、ブラケット記法を使用して指定された位置の値を変更することのコピーメソッド版です。これは指定されたインデックスの要素を指定された値で置き換えた新しい配列の添字を返します。このメソッドのアルゴリズムは Array.prototype.with() と同じです。
型付き配列を変更する場所を示すゼロ基点のインデックスで、整数に変換されます。
value指定された位置に割り当てる値です。
index の要素を value に置き換えた新しい型付き配列。
index >= array.length または index < -array.length の場合に発生します。
詳細については、 Array.prototype.with() をご覧ください。このメソッドは汎用的ではなく、型付き配列インスタンスに対してのみ呼び出すことができます。
| ECMAScript® 2027 Language Specification # sec-%typedarray%.prototype.with |
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.