Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Description
From what I understand,T | unknown andT | any resolve to justunknown andany respectively, so I don't think they're particularly useful.
However maybe it's still useful assuggested type documentation, because such types would still appear asX | unknown in some cases.
Thoughts?
Fail
typeMaybeNumber=number|unknown;functionisNumber(value:number|any):value isnumber{returntypeofvalue==='number';}
Pass
typeMaybeNumber=unknown;functionisNumber(value:any):value isnumber{returntypeofvalue==='number';}