Baseline Widely available
Atomics.store()
ì ì ë©ìëë ë°°ì´ì ì§ì ë ìì¹ì ì§ì ë ê°ì ì ì¥íê³ í´ë¹ ê°ì ë°íí©ëë¤
// Create a SharedArrayBuffer with a size in bytes
const buffer = new SharedArrayBuffer(16);
const uint8 = new Uint8Array(buffer);
uint8[0] = 5;
console.log(Atomics.store(uint8, 0, 2));
// Expected output: 2
console.log(Atomics.load(uint8, 0));
// Expected output: 2
구문
Atomics.store(typedArray, index, value)
ë§¤ê° ë³ì
typedArray
ì ìí íìí ë°°ì´. Int8Array
, Uint8Array
, Int16Array
, Uint16Array
, Int32Array
, Uint32Array
, BigInt64Array
, BigUint64Array
ì¤ íë.
index
value
를 ì ì¥í typedArray
ì ì¸ë±ì¤.
value
ì ì¥í ì«ì.
ì ì¥ë ê°.
ìì¸typedArray
ê° íì©ë ì ìíì´ ìë ê²½ì° TypeError
ê° ë°ìí©ëë¤.index
ê° typedArray
ì ë²ì를 ë²ì´ë ê²½ì° RangeError
ê° ë°ìí©ëë¤.const sab = new SharedArrayBuffer(1024);
const ta = new Uint8Array(sab);
Atomics.store(ta, 0, 12); // 12
ëª
ì¸ì ë¸ë¼ì°ì í¸íì± ê°ì´ 보기
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4