[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/DataView [Back]  [Original]

DataView - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

DataView

Baseline *

20157

*

DataView ArrayBuffer

DataView WebAssembly DataView WebAssembly.Memory

js
const littleEndian = (() => {
  const buffer = new ArrayBuffer(2);
  new DataView(buffer).setInt16(0, 256, true /*  */);
  // Int16Array 
  return new Int16Array(buffer)[0] === 256;
})();
console.log(littleEndian); // true  false

: DataView

DataView()

DataView

DataView.prototype DataView

DataView.prototype.buffer

DataView ArrayBuffer

DataView.prototype.byteLength

DataView

DataView.prototype.byteOffset

ArrayBuffer DataView

DataView.prototype.constructor

DataView DataView

DataView.prototype[Symbol.toStringTag]

[Symbol.toStringTag] "DataView" Object.prototype.toString()

DataView.prototype.getBigInt64()

DataView 8 64

DataView.prototype.getBigUint64()

DataView 8 64

DataView.prototype.getFloat16()

DataView 2 16

DataView.prototype.getFloat32()

DataView 4 32

DataView.prototype.getFloat64()

DataView 8 64

DataView.prototype.getInt16()

DataView 2 16

DataView.prototype.getInt32()

DataView 4 32

DataView.prototype.getInt8()

DataView 1 8

DataView.prototype.getUint16()

DataView 2 16

DataView.prototype.getUint32()

DataView 4 32

DataView.prototype.getUint8()

DataView 1 8

DataView.prototype.setBigInt64()

64 DataView 8

DataView.prototype.setBigUint64()

64 DataView 8

DataView.prototype.setFloat16()

16 DataView 2

DataView.prototype.setFloat32()

32 DataView 4

DataView.prototype.setFloat64()

64 DataView 8

DataView.prototype.setInt16()

16 DataView 2

DataView.prototype.setInt32()

32 DataView 4

DataView.prototype.setInt8()

8 DataView 1

DataView.prototype.setUint16()

16 DataView 2

DataView.prototype.setUint32()

32 DataView 4

DataView.prototype.setUint8()

8 DataView 1

DataView

js
const buffer = new ArrayBuffer(16);
const view = new DataView(buffer, 0);

view.setInt16(1, 42);
view.getInt16(1); // 42

ECMAScript 2027 LanguageSpecification
# sec-dataview-objects


Web Proxy Viewer  |  New URL  |  Original Page