JavaScript DataView.getInt16()

The JavaScript DataView.getInt16() method inserts a signed 16-bit integer number at a specified location.

Range of for unsigned 16-bit integer number:

0 to 65,535

Range of for signed 16-bit integer number:

32,768 to 32,767

Syntax:

dataview.getInt16(byteOffset)

Parameters:
byteoffset: It represents the offset (in byte) from the start of the data view.

Return:
An integer number of 16-bit.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
var dv = new ArrayBuffer(8);
var a = new DataView(dv);
a.setInt16(1,6578.9998);
document.write(a.getInt16(1));
</script>
</body>
</html>