QuizAdvanced

The in Operator Narrowing

Using in to narrow between object types by property presence.

Given `type A = { swim(): void }; type B = { fly(): void }`, how does `if ("swim" in animal)` narrow `animal: A | B`?