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

DataView.prototype.setInt32() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

DataView.prototype.setInt32()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.

DataView setInt32() DataView 4 32 . , .

In this article

// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(16);

const view = new DataView(buffer);
view.setInt32(1, 2147483647); // Max signed 32-bit integer

console.log(view.getInt32(1));
// Expected output: 2147483647

js
setInt32(byteOffset, value)
setInt32(byteOffset, value, littleEndian)

byteOffset

.

value

. .

littleEndian Optional

. false undefined .

undefined.

RangeError

byteOffset .

setInt32()

js
const buffer = new ArrayBuffer(10);
const dataview = new DataView(buffer);
dataview.setInt32(0, 3);
dataview.getInt32(1); // 768

Specification
ECMAScript 2027 LanguageSpecification
# sec-dataview.prototype.setint32


Web Proxy Viewer  |  New URL  |  Original Page