Baseline Widely available
byteLength
ì ê·¼ì ìì±ì íìí ë°°ì´ì 길ì´(ë°ì´í¸)를 ëíë
ëë¤.
// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(8);
const uint8 = new Uint8Array(buffer, 2);
console.log(uint8.byteLength);
// Expected output: 6
ì¤ëª
byteLength
ìì±ì ì ê·¼ì ì¤ì í¨ìê° undefined
ì¸ ì ê·¼ì ìì±ì¼ë¡ ì´ ìì±ì ì½ì ìë§ ììµëë¤. ê°ì TypedArrayê° ìì±ë ë ì¤ì ëë©° ë³ê²½í ì ììµëë¤. TypedArrayê° byteOffset
ëë length
를 ì§ì íì§ ìì¼ë©´ 참조ë ArrayBuffer
ì length
ê° ë°íë©ëë¤. TypedArrayë TypedArray ê°ì²´ ì¤ íëì
ëë¤.
const buffer = new ArrayBuffer(8);
const uint8 = new Uint8Array(buffer);
uint8.byteLength; // 8 (bufferì byteLengthì ì¼ì¹)
const uint8newLength = new Uint8Array(buffer, 1, 5);
uint8newLength.byteLength; // 5 (Uint8Array를 ë§ë¤ ë ì§ì ë ëë¡)
const uint8offSet = new Uint8Array(buffer, 2);
uint8offSet.byteLength; // 6 (ìì±ë Uint8Arrayì ì¤íì
ì¼ë¡ ì¸í´)
ëª
ì¸ì ë¸ë¼ì°ì í¸íì± ê°ì´ 보기
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