If when initializing BigNumber pass '-' and call the .toString() function. An infinite loop will happen because BN.prototype.isZero() only fires if this.length === 1, in which case this.length === 0.
Example:
const BN = require('bn.js');
const a = new BN('-');
console.log(a.toString()); // Infinite loop
If when initializing BigNumber pass '-' and call the .toString() function. An infinite loop will happen because BN.prototype.isZero() only fires if
this.length === 1
, in which casethis.length === 0
.Example: