3 ms·
> Javascript doesn’t have integer type but lets you think it has Actually, JS has integer typed arrays. new Uint8Array([1,100,300]) [1, 100, 44]
by rorrr 14y ago
> Javascript doesn’t have integer type but lets you think it has
Actually, JS has integer typed arrays.
new Uint8Array([1,100,300])
[1, 100, 44]
new Uint16Array([-1,2,300])
[65535, 2, 300]
new Uint32Array([-1,2,300])
[4294967295, 2, 300]
Here's the spec:
https://www.khronos.org/registry/typedarray/specs/latest/#7 https://www.khronos.org/registry/typedarray/specs/latest/#7