setInt8() method stores a signed 8-bit integer (byte)
value at the specified byte offset from the start of the
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
- The offset, in byte, from the start of the view where to store the data.
- The value to set.
- Thrown if the
byteOffsetis set such as it would store beyond the end of the view.
var buffer = new ArrayBuffer(8); var dataview = new DataView(buffer); dataview.setInt8(1, 3); dataview.getInt8(1); // 3
The definition of 'DataView.prototype.setInt8' in that specification.
BCD tables only load in the browser