Boolean conditional statement

Example of If use

Eighth challenge is If

It is common to use conditional statement to get either of branches. Like conditional, or ternary, operator in JavaScript.

Checking if the value is true

Conditional types are what we really need:

If solution

Also I added C extends boolean so we are always sure that we only have true and false ⭐️

If you interested in test cases, please have a look at Playground


Let's chat and have fun 🧑‍💻👩‍💻

No more often than once a week I write 📄 about TypeScript 💪, video playback 📺 and frontend related topics. You can unsubscribe in any time ↘️