Skip to content

Commit

Permalink
Revert "no-typeof-undefined: Add historical note to docs (#1992)"
Browse files Browse the repository at this point in the history
This reverts commit 84a5816.
  • Loading branch information
fisker committed Jan 9, 2023
1 parent fe61924 commit 38b1be1
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions docs/rules/no-typeof-undefined.md
Expand Up @@ -9,8 +9,6 @@

Checking if a value is `undefined` by using `typeof value === 'undefined'` is needlessly verbose. It's generally better to compare against `undefined` directly. The only time `typeof` is needed is when a global variable potentially does not exists, in which case, using `globalThis.value === undefined` may be better.

Historical note: Comparing against `undefined` without `typeof` was frowned upon until ES5. This is no longer a problem since all engines currently in use no longer allow reassigning the `undefined` global.

## Fail

```js
Expand Down

0 comments on commit 38b1be1

Please sign in to comment.