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ยฎ 2026 Language Specification # sec-get-arraybuffer.prototype.maxbytelength |
๋ธ๋ผ์ฐ์ ํธํ์ฑ
Loadingโฆ