Baseline Widely available
byteLength
屿§æè¿°äºè§å¾ä»å®ç ArrayBuffer
å¼å§çåèé¿åº¦ã
// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(16);
const view1 = new DataView(buffer);
const view2 = new DataView(buffer, 12, 4); // From byte 12 for the next 4 bytes
console.log(view1.byteLength + view2.byteLength); // 16 + 4
// Expected output: 20
è¯æ³ æè¿°
byteLength
屿§æ¯ä¸ä¸ªè·å (accessor) 屿§ï¼å®ç set 屿§ä¸º undefined
ï¼è¿æå³ç宿¯åªè¯»çãå¼å¨ DataView
被å建æ¶å°±ç¡®å®äºï¼ä¸ä¸è½æ¹åã妿 DataView
没ææå®åç§»éæ byteLength
ï¼é£ä¹è¢«å¼ç¨ç ArrayBuffer
çåèé¿åº¦å°è¢«è¿åã
byteLength
property
var buffer = new ArrayBuffer(8);
var dataview = new DataView(buffer);
dataview.byteLength; // 8 (matches the byteLength of the buffer)
var dataview2 = new DataView(buffer, 1, 5);
dataview2.byteLength; // 5 (as specified when constructing the DataView)
var dataview3 = new DataView(buffer, 2);
dataview3.byteLength; // 6 (due to the offset of the constructed DataView)
è§è æµè§å¨å
¼å®¹æ§ åè§
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