How different var $firstName or and firstName in jQuery?
When I create var with jquery which is firstName value.
var $firstName = '';
or
var firstName = '';
How different '$' or not.
When I create var with jquery which is firstName value.
var $firstName = '';
or
var firstName = '';
How different '$' or not.
Answers 1
You can just use both of them as $ in variable name has nothing to do with jquery. As long as you have a valid javascript variable name, you can use $ before your variable name.
So for example :
and
when called in console.info() will output same things :