0

If I understood correctly, every number in javascript is 64-bit (i64)?

Does that mean that new Uint8Array([num]) uses less memory than just num?

aleksymous
  • 1
  • 1
  • 1
  • The memory for `num` may be less, but you also have to factor in the memory used for the array header. – Barmar Sep 22 '22 at 21:44
  • But `Uint8Array([1, 2, 3, 4, 5, 6, 7, 8])` should use less memory than `[1, 2, 3, 4, 5, 6, 7, 8]` because the header overhead is amortized. – Barmar Sep 22 '22 at 21:45

0 Answers0