Skip to content

Commit

Permalink
Fix error creating BigInt instances (#674)
Browse files Browse the repository at this point in the history
BigInts are created by calling `BigInt`, which is a factory function, not a constructor. `BigInt` is not instantiated with `new`.

This change fixes an error that @mike-north is puzzled by for a moment in the Frontend Masters course.
  • Loading branch information
sentience authored Oct 1, 2023
1 parent 87de5a0 commit ac8698a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ isJSON(class {})
// @ts-expect-error
isJSON(undefined)
// @ts-expect-error
isJSON(new BigInt(143))
isJSON(BigInt(143))
// @ts-expect-error
isJSON(isJSON)
```
Expand Down Expand Up @@ -93,7 +93,7 @@ isJSON(class {})
// @ts-expect-error
isJSON(undefined)
// @ts-expect-error
isJSON(new BigInt(143))
isJSON(BigInt(143))
// @ts-expect-error
isJSON(isJSON)
```
Expand Down

0 comments on commit ac8698a

Please sign in to comment.