<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Intersection on CodingBlast</title><link>https://codingblast.com/tags/intersection/</link><description>Recent content in Intersection on CodingBlast</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 23 Apr 2017 08:36:48 +0000</lastBuildDate><atom:link href="https://codingblast.com/tags/intersection/index.xml" rel="self" type="application/rss+xml"/><item><title>Intersection types in TypeScript</title><link>https://codingblast.com/typescript-intersection-types/</link><pubDate>Fri, 31 Mar 2017 07:30:12 +0000</pubDate><guid>https://codingblast.com/typescript-intersection-types/</guid><description>&lt;h2 id="intersection-types"&gt;Intersection types&lt;/h2&gt;
&lt;p&gt;Purpose of this post is to get a basic understanding of intersection types and realize pros and cons of intersection types.&lt;/p&gt;
&lt;p&gt;Last time we talked about &lt;a href="https://codingblast.com/typescript-union-types-type-guards-type-aliases/"&gt;union types&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;let x: string | number;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Variable &lt;em&gt;x&lt;/em&gt; can be either &lt;em&gt;string&lt;/em&gt; or a &lt;em&gt;number&lt;/em&gt;. Consequently, you can use type guarding technique to exclude one of the types.&lt;/p&gt;</description></item></channel></rss>