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
constMathNum: Map<string,number>=newMap([['Ο',3.1415926536],['e',2.7182818284],])letc='e'letn=0if(MathNum.has(c)){n=MathNum.get(c)// here is the problem}
π Actual behavior
Yields an error: Type 'number | undefined' is not assignable to type 'number'.
π Expected behavior
Shouldn't be any problem, because we already checked that the map contains the requested key.
The text was updated successfully, but these errors were encountered:
Bug Report
π map has undefined, if map has, map get undefined
π v4.4.3 (latest, October 2021)
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Yields an error: Type 'number | undefined' is not assignable to type 'number'.
π Expected behavior
Shouldn't be any problem, because we already checked that the map contains the requested key.
The text was updated successfully, but these errors were encountered: