pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/DataView/buffer

href="?u=http://developer.mozilla.org/static/client/inter-latin.9a3b1bc220d426ef.woff2" as="font" type="font/woff2" crossorigen="anonymous" fetchpriority="low" />

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

DataView.prototype.buffer

基线 广泛可用

自 2015年7月 起,此特性已在主流浏览器中得到支持,可在大多数设备和浏览器版本中正常使用。

buffer 属性描述了在构造时被 DataView 引用的 ArrayBuffer

尝试一下

// Create an ArrayBuffer
const buffer = new ArrayBuffer(123);

// Create a view
const view = new DataView(buffer);

console.log(view.buffer.byteLength);
// Expected output: 123

语法

dataview.buffer

描述

buffer 属性是一个访问器 (accessor) 属性,它的 set 属性为 undefined,这意味着它是只读的。值在 DataView 被创建时就确定了,且不能改变。

示例

使用 buffer 属性

js
var buffer = new ArrayBuffer(8);
var dataview = new DataView(buffer);
dataview.buffer; // ArrayBuffer { byteLength: 8 }

规范

规范
ECMAScript® 2027 Language Specification
# sec-get-dataview.prototype.buffer

浏览器兼容性

参见

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy