Closed omatrot closed 4 years ago
Of course you can always create a constructor function wrapper:
function BigInteger(...args) {
return bigInt(...args);
}
Then you can use new
:
let x = new BigInteger("hello", 36)
I'm not sure why exactly you would need to do this, though.
Thanks for the input, I need this to use it in conjunction with a serialization library that uses annotations. So it appears it needs to be a class constructor...
I know that bigInt is a function, but I would need to wrap it into something that could allow me to use bigInt with a constructor:
How can I do that, knowing that I'm using TypeScript?