<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	>
<channel>
	<title>Comments on: Did you know that JS can be weird sometimes?</title>
	<atom:link href="http://www.mikedeboer.nl/2008/09/did-you-know-that-js-can-be-weird-sometimes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikedeboer.nl/2008/09/did-you-know-that-js-can-be-weird-sometimes/</link>
	<description>One Singleton to control the Universe</description>
	<pubDate>Sun, 05 Feb 2012 21:16:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Simon</title>
		<link>http://www.mikedeboer.nl/2008/09/did-you-know-that-js-can-be-weird-sometimes/comment-page-1/#comment-949</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Wed, 03 Nov 2010 17:55:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=39#comment-949</guid>
		<description>Jay Smith and frank got it right.</description>
		<content:encoded><![CDATA[<p>Jay Smith and frank got it right.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: frank</title>
		<link>http://www.mikedeboer.nl/2008/09/did-you-know-that-js-can-be-weird-sometimes/comment-page-1/#comment-387</link>
		<dc:creator>frank</dc:creator>
		<pubDate>Sun, 08 Aug 2010 15:25:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=39#comment-387</guid>
		<description>it's not weird. it is natual.</description>
		<content:encoded><![CDATA[<p>it&#8217;s not weird. it is natual.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Piero</title>
		<link>http://www.mikedeboer.nl/2008/09/did-you-know-that-js-can-be-weird-sometimes/comment-page-1/#comment-42</link>
		<dc:creator>Piero</dc:creator>
		<pubDate>Tue, 24 Mar 2009 10:55:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=39#comment-42</guid>
		<description>You should never declare a variable into a conditional (if, while, etc.).

You should declare your variable before with a default value, and then use it in a "if". Its a common rule in all languages, or?</description>
		<content:encoded><![CDATA[<p>You should never declare a variable into a conditional (if, while, etc.).</p>
<p>You should declare your variable before with a default value, and then use it in a &#8220;if&#8221;. Its a common rule in all languages, or?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay Smith</title>
		<link>http://www.mikedeboer.nl/2008/09/did-you-know-that-js-can-be-weird-sometimes/comment-page-1/#comment-34</link>
		<dc:creator>Jay Smith</dc:creator>
		<pubDate>Sun, 18 Jan 2009 23:23:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=39#comment-34</guid>
		<description>functions are designed to be nested within other functions to create a closure -- or a transparent link to it's parent functions context. If you use the 'var' keyword, the intrepreter thinks you will be redefining that var, so it does it for you just prior to the function actually begins to run, hence breaking the closure to the var defined in it's parent.</description>
		<content:encoded><![CDATA[<p>functions are designed to be nested within other functions to create a closure &#8212; or a transparent link to it&#8217;s parent functions context. If you use the &#8216;var&#8217; keyword, the intrepreter thinks you will be redefining that var, so it does it for you just prior to the function actually begins to run, hence breaking the closure to the var defined in it&#8217;s parent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Azrul Syahriman Bin Salleh</title>
		<link>http://www.mikedeboer.nl/2008/09/did-you-know-that-js-can-be-weird-sometimes/comment-page-1/#comment-26</link>
		<dc:creator>Azrul Syahriman Bin Salleh</dc:creator>
		<pubDate>Tue, 02 Dec 2008 02:49:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=39#comment-26</guid>
		<description>This is something.</description>
		<content:encoded><![CDATA[<p>This is something.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fragge</title>
		<link>http://www.mikedeboer.nl/2008/09/did-you-know-that-js-can-be-weird-sometimes/comment-page-1/#comment-24</link>
		<dc:creator>fragge</dc:creator>
		<pubDate>Wed, 24 Sep 2008 01:28:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=39#comment-24</guid>
		<description>hmm actually no, you're right - i didn't read the part about the var in the if (false) :&#124; so it is trying to define an already defined variable (although isn't because the statement is false) but because it has already parsed the line, somewhere in the full parsing by the interpreter the interpreter has assumed something and screwed up. Lemme test in chrome, one sec.. yep chrome screws up too. I'd hazard a guess to say its a parsing error, the script gets parsed and the part which sets the variables (in the parser) is seeing the same declaration twice, but is then being superseded by the if (false) logic, so it reverses the variable definition, which in turn fucks up the original definition because it was superseded by the second. At least thats my theory =P</description>
		<content:encoded><![CDATA[<p>hmm actually no, you&#8217;re right - i didn&#8217;t read the part about the var in the if (false) <img src='http://www.mikedeboer.nl/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' /> so it is trying to define an already defined variable (although isn&#8217;t because the statement is false) but because it has already parsed the line, somewhere in the full parsing by the interpreter the interpreter has assumed something and screwed up. Lemme test in chrome, one sec.. yep chrome screws up too. I&#8217;d hazard a guess to say its a parsing error, the script gets parsed and the part which sets the variables (in the parser) is seeing the same declaration twice, but is then being superseded by the if (false) logic, so it reverses the variable definition, which in turn fucks up the original definition because it was superseded by the second. At least thats my theory =P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fragge</title>
		<link>http://www.mikedeboer.nl/2008/09/did-you-know-that-js-can-be-weird-sometimes/comment-page-1/#comment-23</link>
		<dc:creator>fragge</dc:creator>
		<pubDate>Wed, 24 Sep 2008 01:20:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=39#comment-23</guid>
		<description>Actually, its because you're never parsing test(). You create an instance of it, and then only call callme, which only calls tryXs, so privateVar is never ever defined since thats in the test.call itself. You need to define privateVar in tryXs or call test first, probs best to set it static if thats the case.</description>
		<content:encoded><![CDATA[<p>Actually, its because you&#8217;re never parsing test(). You create an instance of it, and then only call callme, which only calls tryXs, so privateVar is never ever defined since thats in the test.call itself. You need to define privateVar in tryXs or call test first, probs best to set it static if thats the case.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

