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 2021年12月.
Atomics.exchange() は静的メソッドで、指定された値を配列内の指定した位置と交換し、その値を返します。これは不可分操作で、古い値を読み取ってから新しい値を書き込むまでの間に他の物が書き込まないことを保証します。
共有整数の型付き配列です。 Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, BigUint64Array の何れかです。
indextypedArray で value と交換する位置です。
value交換する数値です。
指定された位置 (typedArray[index]) にあった古い値です。
typedArray が許可された整数型のいずれでもない場合に発生します。
RangeErrorindex が typedArray の範囲を超えている場合に発生します。
| ECMAScript® 2027 Language Specification # sec-atomics.exchange |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年7月25日 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.