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
Is a bit of a low value feature, but TS is getting smarter all the time so why not:
If you can assert that a value is the result of a type guard. Why not keep that information for later?
functionreport(unknown:Object){constt=typeofunknown;console.log(unknown,"is a",t);switch(t)// ** {case"string":
lets:string=unknown;// ** should compile without warning.// do string operations with s.break;// More similar cases...}}
The text was updated successfully, but these errors were encountered:
Is a bit of a low value feature, but TS is getting smarter all the time so why not:
If you can assert that a value is the result of a type guard. Why not keep that information for later?
The text was updated successfully, but these errors were encountered: