I'm not familiar with modern JS and tooling to even try something.
References:
https://github.com/tc39/proposal-bigint
Simply invoke BigInt and catch a possible exception:
BigInt
let BigIntSupported = true try { BigInt(1) } catch (e) { BigIntSupported = false }