filmov
tv
Union Types - TypeScript Programming Tutorial #3

Показать описание
With Union Types in TypeScript, you are able to give options as to what data type a value may be. This includes things such as variables, constants, function parameters and even return values. This is an example of an "advanced" type (according to the documentation) and is useful for making generic functions where sometimes it may not be worth writing an extra function for another type, without losing any annotation integrity ;)
In this video I take you through an example with HTML, changing the background color of some elements through the use of a union type in a function. This function can accept either a single HTMLElement or a string and does different things based on which one it is (narrowing).
Check this out:
Follow me on Twitter @dcode!
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
In this video I take you through an example with HTML, changing the background color of some elements through the use of a union type in a function. This function can accept either a single HTMLElement or a string and does different things based on which one it is (narrowing).
Check this out:
Follow me on Twitter @dcode!
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Union Types in TypeScript
Union Types - TypeScript Programming Tutorial #3
The KEY to unions and intersections in TypeScript
TypeScript Crash Course #11 - Union Types
TypeScript Basics 11 - Any and union types
Advanced TypeScript | Union and Intersection Types
Are your TypeScript Unions broken? | Advanced TypeScript
Type unions and intersections | TypeScript introduction for beginners #03
TypeScript Discriminated Unions: Clean Code for Varied Data!
Typescript - 12. Union Types
TypeScript Fundamentals - #8 Union Types Describe One Of Many Options
TypeScript Exhaustive Switch: How discriminated unions make your job easier!
Typescript tutorial for beginners #8 Union types
💥 Typescript Union and Intersection Types- Interface vs Type Aliases
Multiple Types (Union type) Variable | TypeScript Tutorial
TypeScript : Union Types
13 Union Type - TypeScript Tutorial for Beginners
Union Types in TypeScript - TypeScript tutorial
#12 Union Types | Simple TypeScript Course
TypeScript Tutorial #9: Union and Intersection Types in Just 2 Minutes
TypeScript tutorial 7: Union types | Introduction to union types and how to use it in typescript
TypeScript | #9 TypeScript Union Types | Step by Step Tutorial for TypeScript
Understanding Union Types in TypeScript: A Complete Guide
Typescript Union & Typescript Aliases
Комментарии