<?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">
    <channel>
        <title>variables javascript — Sahi Pro Community</title>
        <link>https://community.sahipro.com/forums/</link>
        <pubDate>Fri, 13 Nov 2026 02:52:56 +0000</pubDate>
        <language>en</language>
            <description>variables javascript — Sahi Pro Community</description>
    <atom:link href="https://community.sahipro.com/forums/discussions/tagged/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>JavaScript Variable Naming</title>
        <link>https://community.sahipro.com/forums/discussion/1251/javascript-variable-naming</link>
        <pubDate>Fri, 13 Nov 2009 17:22:07 +0000</pubDate>
        <category>Sahi - Open Source</category>
        <dc:creator>EEconsult</dc:creator>
        <guid isPermaLink="false">1251@/forums/discussions</guid>
        <description><![CDATA[Is there a special purpose for using $ at the beginning of variable names?<br />
<br />
The documentation mentions it for vars, however shows funcitons without them...<br />
<br />
But how should one name Javascript objects? Object references? Methods? innerObjects? etc?<br />
<br />
For example:<br />
<br />
var $myObj = new complexObj();<br />
normalFunction();<br />
<br />
function normalFunction(){ // this is shown in the docs without a $ on the name<br />
}<br />
<br />
function complexObj(){ // this would then seem to also not need a $<br />
this.objectVar = &quot;&quot;:         // but does this need a $ to make it this.$objectVar?<br />
this.objectMethodRef = objectMethod; // should these? and then be called: $myObj.$objectMethodRef(); ?<br />
this.innerObjectRef = innerObject;   // how about these two<br />
<br />
function objectMethod(){  // depending on the above, this may need a $ to match<br />
// contents of method<br />
}<br />
<br />
function innerObject(){ // this might need a $ to match above too<br />
this.innerVar = &quot;&quot;;  // should this have a $<br />
<br />
function innerObjMethod(){ // and for this?<br />
// contents of inner method<br />
}<br />
<br />
}<br />
}<br />
<br />
So far when I test it, naming these both with and without $ on them seems to work.<br />
<br />
As my code gets larger however, I would like to be doing it correctly to avoid problems.<br />
<br />
Does it worth both ways?]]>
        </description>
    </item>
   </channel>
</rss>
