4 ms·
You can interact with binary representations of numbers in JavaScript using typed arrays – https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays
by roryokane 11y ago
You can interact with binary representations of numbers in JavaScript using typed arrays – https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays https://developer.mozilla.org/en-US/docs/Web/JavaScript/Type....
For example, you can get an array of the bytes in a number `n` with this:
new Uint8Array((new Float64Array([n])).buffer)