Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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?
new Uint8Array([num])
num
Uint8Array([1, 2, 3, 4, 5, 6, 7, 8])
[1, 2, 3, 4, 5, 6, 7, 8]
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
nummay be less, but you also have to factor in the memory used for the array header.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.