When you pass variables in Javascript functions, what is the difference between '$name' and 'name'.
For example,
var myFunction = function(name){
name.a = "a";
};
var myFunction = function($name){
$name.b = "b";
};
When you pass variables in Javascript functions, what is the difference between '$name' and 'name'.
For example,
var myFunction = function(name){
name.a = "a";
};
var myFunction = function($name){
$name.b = "b";
};
The only difference in your example is the name, it has no special purpose.
However you might have seen the $name
styled variables in jQuery examples in which it's normal to name selected elements ($('a')
) as, for example, $links
.