<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>compare &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/compare/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>JavaScript Comparision Snippet</title>
		<link>/2010/03/21/javascript-comparision-snippet/</link>
		<comments>/2010/03/21/javascript-comparision-snippet/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 06:35:23 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[compare]]></category>
		<category><![CDATA[operators]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">/?p=1371</guid>
		<description><![CDATA[== vs. === I know this is really for beginners, but have you ever asked yourself what are the differences between == and === when comparing in JavaScript, and when to use it? Here&#8217;s an example: var a = false; alert(a === 0); // prints false That&#8217;s false. Even when both the zero and the &#8230; <a href="/2010/03/21/javascript-comparision-snippet/" class="more-link">Continue reading <span class="screen-reader-text">JavaScript Comparision Snippet</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2011/10/21/does-javascript-undefined-equals-undefined/" rel="bookmark" title="Does JavaScript undefined Equals undefined?">Does JavaScript undefined Equals undefined? </a></li>
<li><a href="/2009/03/09/flex-javascript-communcation-example/" rel="bookmark" title="Flex Javascript communcation example">Flex Javascript communcation example </a></li>
<li><a href="/2010/02/12/how-to-detect-a-variable-existence-in-javascript/" rel="bookmark" title="How to detect a variable existence in JavaScript?">How to detect a variable existence in JavaScript? </a></li>
<li><a href="/2009/07/08/javascript-closures-in-brief/" rel="bookmark" title="JavaScript closures in brief">JavaScript closures in brief </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>== vs. ===</h2>
<p>I know this is really for beginners, but have you ever asked yourself what are the differences between <strong>==</strong> and <strong>===</strong> when comparing in JavaScript, and when to use it? Here&#8217;s an example:</p>
<pre lang="javascript">var a = false;
alert(a === 0); // prints false</pre>
<p>That&#8217;s false. Even when both the zero and the variable are faulty the entire operation is false. Because the 0 is a number and the variable a is boolean, therefore their different types give us the answer. If there was a comparision only with == the result would be true:</p>
<pre lang="javascript">var a = false;
alert(a == 0); // prints true</pre>
<p>It&#8217;s good when you expect some variable to match certain type to compare with ===. So the correct code is:</p>
<pre lang="javascript">var a = false;
alert(a === false); // prints true</pre>
<p>Here the type of a compares with boolean. See the complete <a href="http://www.stoimen.com/projects/javascript.comparision/" target="_blank">demo</a>.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2011/10/21/does-javascript-undefined-equals-undefined/" rel="bookmark" title="Does JavaScript undefined Equals undefined?">Does JavaScript undefined Equals undefined? </a></li>
<li><a href="/2009/03/09/flex-javascript-communcation-example/" rel="bookmark" title="Flex Javascript communcation example">Flex Javascript communcation example </a></li>
<li><a href="/2010/02/12/how-to-detect-a-variable-existence-in-javascript/" rel="bookmark" title="How to detect a variable existence in JavaScript?">How to detect a variable existence in JavaScript? </a></li>
<li><a href="/2009/07/08/javascript-closures-in-brief/" rel="bookmark" title="JavaScript closures in brief">JavaScript closures in brief </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/03/21/javascript-comparision-snippet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flex 3: compare two dates</title>
		<link>/2009/05/12/flex-3-compare-two-dates/</link>
		<comments>/2009/05/12/flex-3-compare-two-dates/#comments</comments>
		<pubDate>Tue, 12 May 2009 12:22:47 +0000</pubDate>
		<dc:creator><![CDATA[stoimen]]></dc:creator>
				<category><![CDATA[flex 3]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[compare]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[setTime]]></category>

		<guid isPermaLink="false">/?p=556</guid>
		<description><![CDATA[Theory of Operation You&#8217;re using Flex 3 and want to compare two dates. The format of the dates is string something like &#8220;2009 May 05&#8221;. The question is &#8230; What&#8217;s the best way to compare them Well if you&#8217;ve the dates as strings and you can easily conver them to something like unix timestamps. If &#8230; <a href="/2009/05/12/flex-3-compare-two-dates/" class="more-link">Continue reading <span class="screen-reader-text">Flex 3: compare two dates</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/05/12/zend_date-with-dates-before-1901/" rel="bookmark" title="Zend_Date with dates before 1901">Zend_Date with dates before 1901 </a></li>
<li><a href="/2009/05/20/flex-3-datechooser-utc-issue/" rel="bookmark" title="Flex 3 DateChooser UTC issue">Flex 3 DateChooser UTC issue </a></li>
<li><a href="/2009/03/01/download-custom-flex-3-datechooser-2/" rel="bookmark" title="Download Custom Flex 3 DateChooser">Download Custom Flex 3 DateChooser </a></li>
<li><a href="/2009/02/06/flex-3-custom-preloader/" rel="bookmark" title="Flex 3 Custom Preloader">Flex 3 Custom Preloader </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Theory of Operation</h2>
<p>You&#8217;re using Flex 3 and want to compare two dates. The format of the dates is string something like &#8220;2009 May 05&#8221;. The question is &#8230;</p>
<h2>What&#8217;s the best way to compare them</h2>
<p>Well if you&#8217;ve the dates as strings and you can easily conver them to something like unix timestamps. If they are a Date object you can try lik so:<span id="more-556"></span></p>
<blockquote><p>date1 = new Date(&#8216;2009&#8217;);</p>
<p>date2 = new Date(&#8216;1990&#8217;);</p>
<p>if (date1.setTime() &lt; date2.setTime())</p></blockquote>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/05/12/zend_date-with-dates-before-1901/" rel="bookmark" title="Zend_Date with dates before 1901">Zend_Date with dates before 1901 </a></li>
<li><a href="/2009/05/20/flex-3-datechooser-utc-issue/" rel="bookmark" title="Flex 3 DateChooser UTC issue">Flex 3 DateChooser UTC issue </a></li>
<li><a href="/2009/03/01/download-custom-flex-3-datechooser-2/" rel="bookmark" title="Download Custom Flex 3 DateChooser">Download Custom Flex 3 DateChooser </a></li>
<li><a href="/2009/02/06/flex-3-custom-preloader/" rel="bookmark" title="Flex 3 Custom Preloader">Flex 3 Custom Preloader </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/05/12/flex-3-compare-two-dates/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
