jquery - Declaring variables javascript -


this question has answer here:

i have quick question , cant find on google. going through code programmer put , declares of javascript variables $ in front of them...for instance:

 var $secondary; 

is there reason this? cause problems in future if jquery ever ends being used. i'm curious because going clean if so.

i use convention keep track of if variable storing jquery object. function getjqueryobject() returns jquery object , want store it.

i.e:

var $myjqobj = getjqueryobject(); 

makes clear $myjqobj jquery object unlike i.e

var mystr = "hello"; 

the $ first character in identifier doesn't have special meaning, aren't invoking method $(), it's valid identifier in javascript. factthat $ used in jquery makes talking before clearer.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -