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
When using the variable to check the type, the type of item and itemB respectively doesn't get narrowed down to the correct type. This works in the first example and it narrows down the type.
This encourages bad practice especially if you are having to repeat the type check over and over. In order to keep code from not becoming repetitive storing that in a variable seems like a much better practice.
TypeScript Version: 3.8.3
Search Terms:
Expected behavior:
No errors to be thrown.
Actual behavior:
When using the variable to check the type, the type of
item
anditemB
respectively doesn't get narrowed down to the correct type. This works in the first example and it narrows down the type.This encourages bad practice especially if you are having to repeat the type check over and over. In order to keep code from not becoming repetitive storing that in a variable seems like a much better practice.
Related Issues:
None
Code
Output
Compiler Options
Playground Link: Provided
The text was updated successfully, but these errors were encountered: