This is going to be a work in progress over a few weeks. In part because the JS implementation is rather bare-bones with few support functions, and in part because with the BigInt type, the JS designers did away with some automated and implicit casting (uh?).
DWScript now has support for the BigInteger type, which supports numbers with as many decimals as the memory allows.
This support comes in two flavors, either through a MPIR dll (a GMP fork) or through Rudy Velthui’s BigIntegers unit.