ArrayBuffer.prototype.maxByteLength
Baseline
2024
Newly available
Since July 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
ArrayBuffer ì¸ì¤í´ì¤ì maxByteLength ì ê·¼ì ìì±ì ë°°ì´ ë²í¼ì í¬ê¸° ì¡°ì ì´ ê°ë¥í ë°ì´í¸ ë¨ìì ìµë 길ì´ë¥¼ ë°íí©ëë¤.
ìëí´ ë³´ê¸°
const buffer = new ArrayBuffer(8, { maxByteLength: 16 });
console.log(buffer.byteLength);
// Expected output: 8
console.log(buffer.maxByteLength);
// Expected output: 16
ì¤ëª
maxByteLength ì ê·¼ì ìì±ì ì¤ì ì ê·¼ì í¨ìê° undefinedì¼ë¡, ì´ ìì±ì ì½ì ìë§ ììµëë¤. ì´ ê°ì ë°°ì´ì´ ìì±ë ë ì¤ì ëë©°, ArrayBuffer() ìì±ìì maxByteLength ìµì
ì íµí´ ì¤ì ëë©° ë³ê²½í ì ììµëë¤.
ì´ ArrayBufferê° ë¶ë¦¬ë ê²½ì° ì´ ìì±ì 0ì ë°íí©ëë¤. maxByteLength ê°ì ì§ì íì§ ìê³ ArrayBufferê° ìì±ë ê²½ì° ì´ ìì±ì ArrayBufferì byteLengthì ê°ê³¼ ê°ì ê°ì ë°íí©ëë¤.
ìì
>maxByteLength ì¬ì©í기
ì´ ìì ìì ìµë í¬ê¸°ê° 16ë°ì´í¸ê¹ì§ í¬ê¸° ì¡°ì ì´ ê°ë¥í 8ë°ì´í¸ ë²í¼ë¥¼ ë§ë¤ê³ ì´ ë²í¼ì maxByteLength를 ë°íí©ëë¤.
const buffer = new ArrayBuffer(8, { maxByteLength: 16 });
buffer.maxByteLength; // 16
ëª ì¸ì
| Specification |
|---|
| ECMAScript® 2027 Language Specification> # sec-get-arraybuffer.prototype.maxbytelength> |