Baseline Widely available
byteLength
㯠TypedArray
ã®ã¢ã¯ã»ãµã¼ããããã£ã§ããã®åä»ãé
åã®é·ããï¼ãã¤ãåä½ã§ï¼è¿ãã¾ãã
// 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 ã¯åä»ãé
åãªãã¸ã§ã¯ãã®ãã¡ã®ä¸ã¤ã§ãã
const buffer = new ArrayBuffer(8);
const uint8 = new Uint8Array(buffer);
uint8.byteLength; // 8 (matches the byteLength of the buffer)
const uint8newLength = new Uint8Array(buffer, 1, 5);
uint8newLength.byteLength; // 5 (as specified when constructing the Uint8Array)
const uint8offSet = new Uint8Array(buffer, 2);
uint8offSet.byteLength; // 6 (due to the offset of the constructed 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