<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Unions on CodingBlast</title><link>https://codingblast.com/tags/unions/</link><description>Recent content in Unions on CodingBlast</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 23 Apr 2017 08:35:21 +0000</lastBuildDate><atom:link href="https://codingblast.com/tags/unions/index.xml" rel="self" type="application/rss+xml"/><item><title>TypeScript - Union types, type guards and type aliases</title><link>https://codingblast.com/typescript-union-types-type-guards-type-aliases/</link><pubDate>Mon, 27 Mar 2017 18:23:11 +0000</pubDate><guid>https://codingblast.com/typescript-union-types-type-guards-type-aliases/</guid><description>&lt;h2 id="union-types"&gt;Union types&lt;/h2&gt;
&lt;p&gt;We can use union types in TypeScript to combine multiple types into one type:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;let text: string | string[];&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Variable &lt;strong&gt;text&lt;/strong&gt; can now be either string or string array which can be pretty handy in some particular cases.&lt;/p&gt;</description></item></channel></rss>