如何对 BigInt 支持进行功能测试?

问题描述 投票:0回答:2

我不熟悉现代 JS 和工具,甚至无法尝试某些东西。

参考资料:

https://github.com/tc39/proposal-bigint

javascript language-features arbitrary-precision ecma262
2个回答
1
投票

if('BigInt' in window)
(或
if(window.BigInt)
)应该就足够了。


0
投票

globalThis.BigInt === BigInt

参考资料:

https://github.com/tc39/proposal-global

© www.soinside.com 2019 - 2024. All rights reserved.