You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//error: This condition will always return 'false' since the types//'"string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"' and '"asdf"' have no overlap.typeofundefined==='asdf'//no error, even though these conditions will also always be false:typeofundefined===undefinedtypeofundefined===null
π Actual behavior
no error when comparing typeof undefined to null or undefined
π Expected behavior
"This condition will always return 'false'" error, as there is no overlap with the return type of typeof (which is "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function")
Bug Report
π Search Terms
typeof undefined null
π Version & Regression Information
v4.2.0-dev.20201223
typeof
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
no error when comparing
typeof undefined
tonull
orundefined
π Expected behavior
"This condition will always return 'false'" error, as there is no overlap with the return type of
typeof
(which is"string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"
)https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#Description
The text was updated successfully, but these errors were encountered: