The dataView.setUint16() is an inbuilt function in dataView which is used to store an unsigned 16-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 byte and it says from the start of the view where to read the data.
Return value: This function does not return anything.
This function does not accept float value that is why it convert 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 convert this value to 3.
When there is no data to be stored, then it gives output as zero (0).
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.