CodesJava

Easy learning with example program codes

JavaScript DataView.getUint16() method

The JavaScript DataView.getUint16() method inserts an unsigned 16-bit integer number at a specified location.

Syntax:

dataview.getUint16(byteOffset)

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

Return:
Unsigned integer number of 16-bit.

Example:

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

Output:

6545
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status