A JavaScript Typed Array Gotcha
https://nullprogram.com/blog/2019/01/23/ [nullprogram.com]
2019-01-23 03:45
So, oldValue is 255. This is a double precision float because all numbers in JavaScript (outside of the bitwise operations) are double precision floating point. Add 1 to this value to get 256, which is newValue. When newValue is stored in the array via PutValue(), it’s converted to an unsigned 8-bit integer, which truncates it to 0.
However, newValue is returned, not the value that was actually stored in the array!