I want to check if a number is a BigInt in an acceptable size if statement
I know there is this try/catch solution:
function isBigInt(x) {
try {
return BigInt(x) === x;
} catch(error) {
return false;
}
}
I want to implement the test directly in an if statement and not as a function.
Can someone help me with this?