<?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:Creating&amp;Managing Classes.Best Code Structure?</title>
	<atom:link href="http://creloadeddesign.com/webdesign/javascriptcreatingmanaging-classes-best-code-structure/feed" rel="self" type="application/rss+xml" />
	<link>http://creloadeddesign.com/webdesign/javascriptcreatingmanaging-classes-best-code-structure</link>
	<description>CRE Loaded Web Design Services</description>
	<lastBuildDate>Tue, 15 Jun 2010 04:26:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: WaMSie</title>
		<link>http://creloadeddesign.com/webdesign/javascriptcreatingmanaging-classes-best-code-structure/comment-page-1#comment-83</link>
		<dc:creator>WaMSie</dc:creator>
		<pubDate>Fri, 15 Jan 2010 23:47:17 +0000</pubDate>
		<guid isPermaLink="false">http://creloadeddesign.com/webdesign/javascriptcreatingmanaging-classes-best-code-structure#comment-83</guid>
		<description>You do a whole lot of searching there.

Writing a.b is the same as writing a[&quot;b&quot;]. So you can create an object and store things in it by saying:

a[&quot;b&quot;] = 42;

Equally well you can text if there is already a value there thus:

if (a[&quot;b&quot;] == null) a[&quot;b&quot;] = 10;

And where I&#039;ve used the constant &quot;b&quot;, you can use a variable.

function ext(id)
{
return a[id] != null;
}

And it should make your code smaller and faster!</description>
		<content:encoded><![CDATA[<p><p>&#89;&#111;&#117; &#100;&#111; a whole lot &#111;&#102; searching &#116;&#104;&#101;&#114;&#101;.</p>
<p>Writing a.b &#105;&#115; &#116;&#104;&#101; same &#97;&#115; writing a[&quot;b&quot;]. &#83;&#111; &#121;&#111;&#117; &#99;&#97;&#110; &#99;&#114;&#101;&#97;&#116;&#101; &#97;&#110; object &#97;&#110;&#100; store things &#105;&#110; &#105;&#116; &#98;&#121; saying:</p>
<p>a[&quot;b&quot;] = 42;</p>
<p>Equally well &#121;&#111;&#117; &#99;&#97;&#110; text &#105;&#102; &#116;&#104;&#101;&#114;&#101; &#105;&#115; already a value &#116;&#104;&#101;&#114;&#101; thus:</p>
<p>&#105;&#102; (a[&quot;b&quot;] == null) a[&quot;b&quot;] = 10;</p>
<p>&#65;&#110;&#100; &#119;&#104;&#101;&#114;&#101; I&#8217;ve used &#116;&#104;&#101; constant &quot;b&quot;, &#121;&#111;&#117; &#99;&#97;&#110; &#117;&#115;&#101; a variable.</p>
<p>function ext(id)<br />
{<br />
return a[id] != null;<br />
}</p>
<p>&#65;&#110;&#100; &#105;&#116; &#115;&#104;&#111;&#117;&#108;&#100; &#109;&#97;&#107;&#101; &#121;&#111;&#117;&#114; code smaller &#97;&#110;&#100; &#102;&#97;&#115;&#116;&#101;&#114;!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
