skip to Main Content

Javascript – Correct use of getUint16()

How to properly access the elements in data views based on the data type? Consider the following example code: const data = new Uint16Array([7, 12, 100]); const view = new DataView(data.buffer); console.log(view.getUint16(0), view.getUint16(1), view.getUint16(3)); The output is 1792 12 100.…

VIEW QUESTION
Back To Top
Search