jquery - Declaring variables javascript -
this question has answer here:
- why javascript variable start dollar sign? 15 answers
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
Post a Comment