Skip to content

Commit

Permalink
docs: fix typos in use-isnan (#19190)
Browse files Browse the repository at this point in the history
  • Loading branch information
lumirlumir authored Nov 28, 2024
1 parent 0c8cea8 commit 9eefc8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/src/rules/use-isnan.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ In JavaScript, `NaN` is a special value of the `Number` type. It's used to repre

Because `NaN` is unique in JavaScript by not being equal to anything, including itself, the results of comparisons to `NaN` are confusing:

* `NaN === NaN` or `NaN == NaN` evaluate to false
* `NaN !== NaN` or `NaN != NaN` evaluate to true
* `NaN === NaN` or `NaN == NaN` evaluate to `false`
* `NaN !== NaN` or `NaN != NaN` evaluate to `true`

Therefore, use `Number.isNaN()` or global `isNaN()` functions to test whether a value is `NaN`.

## Rule Details

This rule disallows comparisons to 'NaN'.
This rule disallows comparisons to `NaN`.

Examples of **incorrect** code for this rule:

Expand Down

0 comments on commit 9eefc8f

Please sign in to comment.