Skip to content

Commit

Permalink
docs: Add missing no-new-native-nonconstructor docs code fence (#16503)
Browse files Browse the repository at this point in the history
  • Loading branch information
btmills committed Nov 6, 2022
1 parent e950964 commit c97c789
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/rules/no-new-native-nonconstructor.md
Expand Up @@ -19,6 +19,7 @@ let foo = new Symbol("foo");

// throws a TypeError
let result = new BigInt(9007199254740991);
```

Both `new Symbol` and `new BigInt` throw a type error because they are functions and not classes. It is easy to make this mistake by assuming the uppercase letters indicate classes.

Expand Down

0 comments on commit c97c789

Please sign in to comment.