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
To be clear, these can't be type predicates today because x is number is an "if and only if" relation - if the predicate is false, TS assumes x is not a number.
π Search Terms
Use isNumber() isNan() isFinite() as type predicates
β Viability Checklist
β Suggestion
Number
provides several functions that could be used as type predicates.Currently, those functions provide no indication about the type of the value that passes the test:
π Motivating Example
The exemple is self-explanatory.
π» Use Cases
What workarounds are you using in the meantime?
Manual casting to a related type.
The text was updated successfully, but these errors were encountered: