Skip to content

Commit

Permalink
Update BigInt.js
Browse files Browse the repository at this point in the history
Replace the === operator with the advised isNaN function
  • Loading branch information
Ebmtranceboy authored Sep 21, 2023
1 parent 28129de commit 104da73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/JS/BigInt.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const fromStringAsImpl = function (just) {

function f(acc, chunk) {
let n = BigInt(parseInt(chunk, radix));
if (n === NaN) {
if (isNaN(n)) {
throw new Error("Invalid number");
} else {
return acc * factor + n;
Expand Down

0 comments on commit 104da73

Please sign in to comment.