3 ms·
This whole problem will probably be solved with Typed Objects, which looks as though they'll be standardised with ES7 next year. Plus, there's already a decent
by thomasfoster96 11y ago
This whole problem will probably be solved with Typed Objects, which looks as though they'll be standardised with ES7 next year. Plus, there's already a decent typed objects polyfill available, so don't go littering your code with bitwise operations.
- codecurve 11y agoThat's good to hear, I wasn't aware of Typed Objects. I guess the library linked at the end of the post is basically a very non-specific polyfill already? Well, using it like that is one way to get around bitwise littering.
- thomasfoster96 11y agoThe library at the bottom isn't anywhere near a typed objects polyfill - it just packs data into small spaces. Typed Objevts would let you have objects where properties are of a static type (int8, Boolean, string) and they are stored using Array Buffers.
- codecurve 11y agoSure, the underlying storage mechanisms are different and it doesn't support as many types, but I didn't say it was a good polyfill.