<?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: JavaScript summed up #8: Reflection</title>
	<atom:link href="http://blog.puremedia-online.de/2009/09/24/javascript-summed-up-8-reflection/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.puremedia-online.de/2009/09/24/javascript-summed-up-8-reflection/</link>
	<description>beyond applications and software</description>
	<lastBuildDate>Thu, 01 Oct 2009 08:36:43 +0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tobias Günther</title>
		<link>http://blog.puremedia-online.de/2009/09/24/javascript-summed-up-8-reflection/comment-page-1/#comment-19</link>
		<dc:creator>Tobias Günther</dc:creator>
		<pubDate>Fri, 25 Sep 2009 07:08:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.puremedia-online.de/?p=212#comment-19</guid>
		<description>Hi Phil, related to that, you can look at my previous article on &quot;Type Checking&quot; (http://blog.puremedia-online.de/2009/08/20/javascript-summed-up-3-type-checking/) where &#039;constructor&#039; is explained.</description>
		<content:encoded><![CDATA[<p>Hi Phil, related to that, you can look at my previous article on &#8220;Type Checking&#8221; (<a href="http://blog.puremedia-online.de/2009/08/20/javascript-summed-up-3-type-checking/" rel="nofollow">http://blog.puremedia-online.de/2009/08/20/javascript-summed-up-3-type-checking/</a>) where &#8216;constructor&#8217; is explained.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil Idem</title>
		<link>http://blog.puremedia-online.de/2009/09/24/javascript-summed-up-8-reflection/comment-page-1/#comment-18</link>
		<dc:creator>Phil Idem</dc:creator>
		<pubDate>Thu, 24 Sep 2009 17:27:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.puremedia-online.de/?p=212#comment-18</guid>
		<description>A better alternative to using typeof is to use the built-in &quot;constructor&quot; property. For example:
for ( prop in myObject ){
    var property = myObject[prop];
    if (property  &amp;&amp; property.constructor === Function) {
        // ...that&#039;s a function
    }
}

The &quot;constructor&quot; argument references the function that created the object.

function MyConstructor()
{
}

var obj = new MyConstructor();
alert(obj.constructor === MyConstructor); // true

Might be worth mentioning that you can check for property existence with one of these expressions:
myObject.myProperty !== undefined
myObject.myProperty === undefined

Don&#039;t use this: typeof(myObject.myProperty) != &quot;undefined&quot;</description>
		<content:encoded><![CDATA[<p>A better alternative to using typeof is to use the built-in &#8220;constructor&#8221; property. For example:<br />
for ( prop in myObject ){<br />
    var property = myObject[prop];<br />
    if (property  &amp;&amp; property.constructor === Function) {<br />
        // &#8230;that&#8217;s a function<br />
    }<br />
}</p>
<p>The &#8220;constructor&#8221; argument references the function that created the object.</p>
<p>function MyConstructor()<br />
{<br />
}</p>
<p>var obj = new MyConstructor();<br />
alert(obj.constructor === MyConstructor); // true</p>
<p>Might be worth mentioning that you can check for property existence with one of these expressions:<br />
myObject.myProperty !== undefined<br />
myObject.myProperty === undefined</p>
<p>Don&#8217;t use this: typeof(myObject.myProperty) != &#8220;undefined&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
