DataView.prototype.setInt16()
DataView.prototype.setInt16() is a JavaScript method in the Typed Array category. Writes a signed 16-bit integer. The syntax is dv.setInt16(byteOffset, value, littleEndian). A typical example: new DataView(buf).setInt16(0, -32768). A close sibling is Int8Array, which 8-bit signed integer array. A close sibling is Uint8Array, which 8-bit unsigned integer array. A close sibling is Float64Array, which 64-bit float array. A close sibling is ArrayBuffer, which fixed-length binary buffer. More about this category: Typed arrays for binary data. Related Typed Array methods: Int8Array, Uint8Array, Float64Array, ArrayBuffer, Int32Array, Uint16Array, BigInt64Array, BigUint64Array. This page is part of the free JS Reference documentation covering 1027+ methods, each with syntax, parameters, return values, examples, and common pitfalls. You can try DataView.prototype.setInt16() immediately in the JavaScript playground, look up unfamiliar terms in the glossary, or return to the JS Reference homepage.