<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Diego Castro on Medium]]></title>
        <description><![CDATA[Stories by Diego Castro on Medium]]></description>
        <link>https://medium.com/@diegocastro_7330?source=rss-405db84d9269------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*h_1SLTQ3q2pflvV0x9BuDQ@2x.jpeg</url>
            <title>Stories by Diego Castro on Medium</title>
            <link>https://medium.com/@diegocastro_7330?source=rss-405db84d9269------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 14:19:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@diegocastro_7330/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Falsy Values on JS]]></title>
            <link>https://medium.com/@diegocastro_7330/falsy-values-on-js-e8a542166add?source=rss-405db84d9269------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8a542166add</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[vanillajs]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Diego Castro]]></dc:creator>
            <pubDate>Tue, 18 Oct 2016 19:57:26 GMT</pubDate>
            <atom:updated>2016-10-21T20:57:57.707Z</atom:updated>
            <content:encoded><![CDATA[<p>Normally we are used to see the if statement with as a comparison, like this:</p><p>var a =10;</p><p>if( a &gt; 8){</p><p>//statement</p><p>}</p><p>But how often do we see something like :</p><p>var a =10;</p><p>if(a){</p><p>//statement</p><p>}</p><p>You may ask what is being compared at this point, well in Javascript we have the Falsy Values, those are :</p><ul><li>0</li><li>-0</li><li>false</li><li>null</li><li>undefined</li><li>NaN</li><li>“”</li></ul><p>Below you can check some test for falsy values</p><pre>0 == false  //true<br>&quot;&quot; == false //true<br>0 == &quot;&quot;     //true</pre><p>Also we can see that undefined and null are considered to not be equivalent to anything except themselves.</p><pre>(null == false) // false<br>(null == null) // true<br>(undefined == undefined) // true<br>(undefined == null)// true</pre><p>I found this particular case when NaN == NaN // False, after doing some research I found the answer here <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3">http://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3</a></p><p>TL;DR : there are many ways to represent a NaN, it makes sense that one NaN will not be equal to another NaN</p><pre>NaN == undefined //false<br>NaN == NaN //false</pre><p>If our variable has any of those values it will be evaluated as false and won’t enter into the block. <strong>Remember to memorize the list and understand that we are not checking if the variable exists, as its the common conception, we are checking the value of it.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8a542166add" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>