Closed
Description
🔎 Search Terms
boolean
🕗 Version & Regression Information
Seems like this issue is easily reproduced for v3, v4 to v5
I personally had not encounter this issue as I use const
when declaring variables almost all the time, might have been an intended design instead?
⏯ Playground Link
💻 Code
let a = false // inferred as "boolean"
a // inferred as "false" afterwards (but should remain as boolean instead)
let b = '' // inferred as "string"
b // still inferred as "string"
let c = 0 // inferred as "number"
c // still inferred as "number"
🙁 Actual behavior
given let a = false
the typeof variable a should be boolean
but instead was false
🙂 Expected behavior
given let a = false
the typeof variable a must be boolean
, as it's inconsistent with other types such as ''
/0
and it's inferred as string
/number
respectively
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
No labels