Standard built-ins
DataView.prototype.setUint32()
Writes a unsigned 32-bit integer at an arbitrary byte offset. The entire value must fit in the view; otherwise a RangeError is thrown.
Formal Syntax & Structure
javascript syntaxjavascript
view.setUint32(byteOffset, value, littleEndian?)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| byteOffset | number | Starting byte offset within the view. |
| value | number | Value to encode as a unsigned 32-bit integer. |
| littleEndian | boolean | True for little-endian; omitted or false means big-endian. |
Return Value
undefined
Changes the bytes in the backing buffer.
Working Example
Example Snippetjavascript
const view=new DataView(new ArrayBuffer(5)); const result=view.setUint32(1,4000000000,true); console.log(String(result),String(view.getUint32(1,true)));