Below is the example of the dataView.setUint32() Method.
The dataView.setUint32() is an inbuilt function in dataView which is used to store an unsigned 32-bit integer at the specified location i.e, at byte offset from the start of the dataView.
Parameters: It has parameter byteOffset which is offset in a byte and it says from the start of the view were to read the data.
Return value: This function does not return anything.
Input: dataview1.setUint32(1, 56); Output: 56
Input: dataview1.setUint32(1, Math.PI); Output: 3
This function does not accept float value that is why it converts float value to integer value. It can be seen from the output of the below program it should give output as 3.14 (the value of PI) but this function converts this value to 3.
When there is no data to be stored, then it gives output as zero (0).
- Google Chrome 9 and above
- Firefox 15 and above
- Apple Safari 5.1 and above
- Opera 12.1 and above
- Edge 12 and above