У нас вы можете посмотреть бесплатно Union Types - TypeScript Programming Tutorial #3 или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
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: https://www.typescriptlang.org/docs/h... 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!