4 ms·
Hm, does this work in Safari? https://caniuse.com/#feat=bigint https://caniuse.com/#feat=bigint
by justicz 6y ago
Hm, does this work in Safari? https://caniuse.com/#feat=bigint https://caniuse.com/#feat=bigint
- jakear 6y ago“Syntax Error: No identifiers allowed directly after numeric literal”
- The_rationalist 6y agoDoes X work in Safari can almost always be answered by 'no' iff the feature is from a recent(less than a decade) spec
- recursive 6y agoSafari is the new IE.
- ralusek 6y agoNot yet, but I believe babel and others just transpile/polyfill it by having it fall back on a string arithmetic library for working with integers of arbitrary precision.
- recursive 6y agoThat will never be totally reliable as 1) javascript is dynamically typed 2) javascript doesn't support operator overloading. Nonetheless, there are attempts. https://www.npmjs.com/package/babel-plugin-transform-bigint https://www.npmjs.com/package/babel-plugin-transform-bigint > Update: Now it can convert a code using BigInt into a code using JSBI (https://github.com/GoogleChromeLabs/jsbi https://github.com/GoogleChromeLabs/jsbi). It will try to detect when an operator is used for bigints, not numbers. This will not work in many cases, so please use JSBI directly only if you know, that the code works only with bigints. (emphasis mine)