From 0f905531dfb28a4c70cb2281c45eb9c887f14915 Mon Sep 17 00:00:00 2001 From: v01d3tr Date: Mon, 25 Feb 2019 05:43:49 +0100 Subject: [PATCH] feat: added info about typeof null (#26899) * feat: added info about typeof null * Further clarify change --- guide/english/javascript/typeof/index.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/guide/english/javascript/typeof/index.md b/guide/english/javascript/typeof/index.md index 2e2af4b6b8..8a192e0669 100644 --- a/guide/english/javascript/typeof/index.md +++ b/guide/english/javascript/typeof/index.md @@ -83,11 +83,15 @@ Even thought this is a useful validation method, we have to be careful because j ```javascript var x = [1,2,3,4]; console.log(typeof x) // object - console.log(typeof null) // object - ``` +The last example above is a well-known JavaScript 'mistake' and a fix was proposed in ECMAScript, which would have resulted in: +```javascript +typeof null === 'null' // true +``` +But due to major legacy issues it had to be rejected. + ### More Information: MDN Documentation for typeof