0

I came across some function declaration like below.


type DataType = TypeA | TypeB | TypeC;

function Func(data: DataType): data is TypeA {
...
}

I don't understand the is part of the declaration. How it affects the return type of the function?

2

1 Answer 1

0

This Stackoverflow post might help you understand the is keyword a little better.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.