| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint8 | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.
DataView setUint8()
DataView 1 8 .
// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(16);
const view = new DataView(buffer);
view.setUint8(1, 255); // Max unsigned 8-bit integer
console.log(view.getUint8(1));
// Expected output: 255
setUint8(byteOffset, value)
RangeError byteOffset .
const buffer = new ArrayBuffer(10);
const dataview = new DataView(buffer);
dataview.setUint8(0, 3);
dataview.getUint8(0); // 3
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-dataview.prototype.setuint8 |
This page was last modified on 2025 2 11 by MDN contributors.
DataViewDataView.prototype.getBigInt64()DataView.prototype.getBigUint64()DataView.prototype.getFloat16()DataView.prototype.getFloat32()DataView.prototype.getFloat64()DataView.prototype.getInt8()DataView.prototype.getInt16()DataView.prototype.getInt32()DataView.prototype.getUint8()DataView.prototype.getUint16()DataView.prototype.getUint32()DataView.prototype.setBigInt64()DataView.prototype.setBigUint64()DataView.prototype.setFloat16()DataView.prototype.setFloat32()DataView.prototype.setFloat64()DataView.prototype.setInt8()DataView.prototype.setInt16()DataView.prototype.setInt32()DataView.prototype.setUint8()DataView.prototype.setUint16()DataView.prototype.setUint32()Object/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |