Baseline Widely available
Uint8Array()
ìì±ìë 8ë¹í¸ ë¶í¸ìë ì ìì íìí ë°°ì´(TypedArray)ì ìì±í©ëë¤. ë°°ì´ì ë´ì©ì 0ì¼ë¡ ì´ê¸°íë©ëë¤. ë°°ì´ì´ ìì±ëë©´ ê°ì²´ì ë©ìë를 ì¬ì©íê±°ë íì¤ ë°°ì´ ì¸ë±ì¤ 구문(ì¦, ëê´í¸ íê¸°ë² ì¬ì©)ì ì¬ì©íì¬ ë°°ì´ì ìì를 참조í ì ììµëë¤.
new Uint8Array()
new Uint8Array(length)
new Uint8Array(typedArray)
new Uint8Array(object)
new Uint8Array(buffer)
new Uint8Array(buffer, byteOffset)
new Uint8Array(buffer, byteOffset, length)
매ê°ë³ìì°¸ê³ :
Uint8Array()
ë ì¤ì§new
ë¡ë§ ìì±í ì ììµëë¤.new
ìì´ í¸ì¶ì ìëíë©´TypeError
ìì¸ê° ë°ìí©ëë¤
TypedArray
를 ì°¸ê³ íì¸ì.
TypedArray
를 ì°¸ê³ íì¸ì.
// 길ì´ë¡ë¶í° ìì±
const uint8 = new Uint8Array(2);
uint8[0] = 42;
console.log(uint8[0]); // 42
console.log(uint8.length); // 2
console.log(uint8.BYTES_PER_ELEMENT); // 1
// ë°°ì´ë¡ë¶í°
const x = new Uint8Array([21, 31]);
console.log(x[1]); // 31
// ë¤ë¥¸ TypedArrayë¡ë¶í°
const y = new Uint8Array(x);
console.log(y[0]); // 21
// ArrayBufferë¡ë¶í°
const buffer = new ArrayBuffer(8);
const z = new Uint8Array(buffer, 1, 4);
console.log(z.byteOffset); // 1
// ìíë¡ë¶í°
const iterable = (function* () {
yield* [1, 2, 3];
})();
const uint8FromIterable = new Uint8Array(iterable);
console.log(uint8FromIterable);
// Uint8Array [1, 2, 3]
ëª
ì¸ì ë¸ë¼ì°ì í¸íì± ê°ì´ 보기
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