<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: More about Creating Objects in JavaScript</title>
	<link>http://www.w3style.co.uk/more-about-creating-objects-in-javascript</link>
	<description>Chris Corbyn, WebGeek</description>
	<pubDate>Tue, 02 Dec 2008 12:12:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2</generator>

	<item>
		<title>By: chris</title>
		<link>http://www.w3style.co.uk/more-about-creating-objects-in-javascript#comment-857</link>
		<author>chris</author>
		<pubDate>Wed, 22 Aug 2007 21:07:30 +0000</pubDate>
		<guid>http://www.w3style.co.uk/more-about-creating-objects-in-javascript#comment-857</guid>
		<description>Sort of, you can do this:

[code lang="javascript"]
function someObject() {
  //whatever here
}
someObject.SOME_FIELD = 42;

alert(someObject.SOME_FIELD);[/code]

I'm not aware of a way to make objects immutable or constant though. That's not to say it can't be done however.</description>
		<content:encoded><![CDATA[<p>Sort of, you can do this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">function</span> someObject<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="co1">//whatever here</span><br />
<span class="br0">&#125;</span><br />
someObject.<span class="me1">SOME_FIELD</span> = <span class="nu0">42</span>;</p>
<p><span class="kw3">alert</span><span class="br0">&#40;</span>someObject.<span class="me1">SOME_FIELD</span><span class="br0">&#41;</span>;</div>
</div>
<p>I&#8217;m not aware of a way to make objects immutable or constant though. That&#8217;s not to say it can&#8217;t be done however.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anjanesh</title>
		<link>http://www.w3style.co.uk/more-about-creating-objects-in-javascript#comment-849</link>
		<author>Anjanesh</author>
		<pubDate>Wed, 22 Aug 2007 15:45:26 +0000</pubDate>
		<guid>http://www.w3style.co.uk/more-about-creating-objects-in-javascript#comment-849</guid>
		<description>Are there workarounds for constants and static members &#38; methods ?

The const keyword seems to exist - but not accessible from outside the class like obj1.c1 or someObject.c1
&lt;code&gt;
function someObject()
 {
        const c1 = 1;
 }
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Are there workarounds for constants and static members &amp; methods ?</p>
<p>The const keyword seems to exist - but not accessible from outside the class like obj1.c1 or someObject.c1</p>
<div class="codesnip-container" >function someObject()<br />
 {<br />
        const c1 = 1;<br />
 }</div>
]]></content:encoded>
	</item>
</channel>
</rss>
