
Getting Started with TypeScript
Ladybug Podcast
00:00
How to Declare a Union Type in Typescript
We're not talking about unions like you're going on, really, but nice drive that be fun yisn important topic to discuss. Let's go back to our ad function. Remember it took in two numbers and returned their sum? So let's make this a little bit more extensible. We can declare the type as a number or string where the or is actually the piping symbol. And if you're listening and know the answer, tell us.
Transcript
Play full episode