CodesJava

Easy learning with example program codes

JavaScript DataView.getInt8() method

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

Syntax:

dataview.getInt8(byteOffset)

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

Return:
Integer number of 8-bit.

Example:

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

Output:

56
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status