<?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: An Introduction to JavaScript&#8217;s &#8220;this&#8221;</title>
	<atom:link href="http://justin.harmonize.fm/index.php/2009/09/an-introduction-to-javascripts-this/feed/" rel="self" type="application/rss+xml" />
	<link>http://justin.harmonize.fm/index.php/2009/09/an-introduction-to-javascripts-this/</link>
	<description>A cup of coffee and a soapbox is like a bottle of Jack and a gun.</description>
	<lastBuildDate>Thu, 04 Feb 2010 10:36:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anonymous</title>
		<link>http://justin.harmonize.fm/index.php/2009/09/an-introduction-to-javascripts-this/comment-page-1/#comment-399</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 04 Feb 2010 10:36:23 +0000</pubDate>
		<guid isPermaLink="false">http://justin.harmonize.fm/?p=298#comment-399</guid>
		<description>&lt;strong&gt;Caffeinated Simpleton » Blog Archive » An Introduction to JavaScript’s “this”...&lt;/strong&gt;

JavaScript is an amazing little language, but it&#8217;s got some quirks that turn a lot of people off. One of those quirks is this, and how it&#8217;...</description>
		<content:encoded><![CDATA[<p><strong>Caffeinated Simpleton » Blog Archive » An Introduction to JavaScript’s “this”&#8230;</strong></p>
<p>JavaScript is an amazing little language, but it&#8217;s got some quirks that turn a lot of people off. One of those quirks is this, and how it&#8217;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uberVU - social comments</title>
		<link>http://justin.harmonize.fm/index.php/2009/09/an-introduction-to-javascripts-this/comment-page-1/#comment-398</link>
		<dc:creator>uberVU - social comments</dc:creator>
		<pubDate>Wed, 03 Feb 2010 23:07:01 +0000</pubDate>
		<guid isPermaLink="false">http://justin.harmonize.fm/?p=298#comment-398</guid>
		<description>&lt;strong&gt;Social comments and analytics for this post...&lt;/strong&gt;

This post was mentioned on Hackernews by mhansen: The way I remember it: this is whatever is before the dot when you call the function.E.g. for car.drive(); in the drive function, any reference to &#039;this&#039; will get &#039;car&#039;. If the function is called on...</description>
		<content:encoded><![CDATA[<p><strong>Social comments and analytics for this post&#8230;</strong></p>
<p>This post was mentioned on Hackernews by mhansen: The way I remember it: this is whatever is before the dot when you call the function.E.g. for car.drive(); in the drive function, any reference to &#8216;this&#8217; will get &#8216;car&#8217;. If the function is called on&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vilcans</title>
		<link>http://justin.harmonize.fm/index.php/2009/09/an-introduction-to-javascripts-this/comment-page-1/#comment-335</link>
		<dc:creator>vilcans</dc:creator>
		<pubDate>Tue, 29 Sep 2009 10:40:23 +0000</pubDate>
		<guid isPermaLink="false">http://justin.harmonize.fm/?p=298#comment-335</guid>
		<description>Good article. I have been very confused by &quot;this&quot;.</description>
		<content:encoded><![CDATA[<p>Good article. I have been very confused by &#8220;this&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olivier Mengué</title>
		<link>http://justin.harmonize.fm/index.php/2009/09/an-introduction-to-javascripts-this/comment-page-1/#comment-334</link>
		<dc:creator>Olivier Mengué</dc:creator>
		<pubDate>Tue, 29 Sep 2009 06:24:55 +0000</pubDate>
		<guid isPermaLink="false">http://justin.harmonize.fm/?p=298#comment-334</guid>
		<description>Variable scope in JavaScript is function. There is no block scope.&lt;br&gt;Defining variable &#039;a&#039; with a &#039;var&#039; statement inside the loop is just misleading. JavaScript is not Java.&lt;br&gt;So the two version do the same.&lt;br&gt;&lt;br&gt;Also you didn&#039;t test your code at all.. Else you would have seen that alert is not called by setTimeOut but instead inside the loop.&lt;br&gt;You should have written this:&lt;br&gt;setTimeout(function { alert(i) }, 500);</description>
		<content:encoded><![CDATA[<p>Variable scope in JavaScript is function. There is no block scope.<br />Defining variable &#39;a&#39; with a &#39;var&#39; statement inside the loop is just misleading. JavaScript is not Java.<br />So the two version do the same.</p>
<p>Also you didn&#39;t test your code at all.. Else you would have seen that alert is not called by setTimeOut but instead inside the loop.<br />You should have written this:<br />setTimeout(function { alert(i) }, 500);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hugobryn</title>
		<link>http://justin.harmonize.fm/index.php/2009/09/an-introduction-to-javascripts-this/comment-page-1/#comment-332</link>
		<dc:creator>hugobryn</dc:creator>
		<pubDate>Mon, 28 Sep 2009 20:11:13 +0000</pubDate>
		<guid isPermaLink="false">http://justin.harmonize.fm/?p=298#comment-332</guid>
		<description>There is a bit more to the setTimeout() function to be totally clear:&lt;br&gt;&lt;br&gt;1) setTimeout(myObj.myFunc, 1000) - this set to global window object&lt;br&gt;&lt;br&gt;2) setTimeout(function() { myObj.myFunc() }, 1000) - this set to myObj as we want it.&lt;br&gt;&lt;br&gt;But you can also pass a string to setTimeout and basically setTimeout() becomes a sort of eval:&lt;br&gt;&lt;br&gt;3) setTimeout(&#039;myObj.myFunc()&#039;, 1000) - this set to myObj&lt;br&gt;&lt;br&gt;Number 2 is the best way to go though.</description>
		<content:encoded><![CDATA[<p>There is a bit more to the setTimeout() function to be totally clear:</p>
<p>1) setTimeout(myObj.myFunc, 1000) &#8211; this set to global window object</p>
<p>2) setTimeout(function() { myObj.myFunc() }, 1000) &#8211; this set to myObj as we want it.</p>
<p>But you can also pass a string to setTimeout and basically setTimeout() becomes a sort of eval:</p>
<p>3) setTimeout(&#39;myObj.myFunc()&#39;, 1000) &#8211; this set to myObj</p>
<p>Number 2 is the best way to go though.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
