From 38b1be1553038efe2f9dfef4ab1d3b77a3fd6ca2 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 9 Jan 2023 23:52:38 +0800 Subject: [PATCH] Revert "`no-typeof-undefined`: Add historical note to docs (#1992)" This reverts commit 84a58165cd9b573ed0ffdb6532087bc61b861a8a. --- docs/rules/no-typeof-undefined.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/rules/no-typeof-undefined.md b/docs/rules/no-typeof-undefined.md index 85dde54fe1..900edfbbd9 100644 --- a/docs/rules/no-typeof-undefined.md +++ b/docs/rules/no-typeof-undefined.md @@ -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