Why is there a $ in my javascript?
<p>I have the following:</p>

<pre><code>var doHandler = function (link, form, close) {
    var $form = form;
    var $link = link;
    var dialogTitle = $form.find("#Title").val();
    // some code
}
</code></pre>

<p>I'd like to change this to:</p>

<pre><code>function doTask(??) {
  var dialogTitle = $form.find("#Title").val();
  // some code
}
var doHandler = function (link, form, close) {
    var $form = form;
    var $link = link;
    doTask(??)
}
</code></pre>

<p>Can someone explain:</p>

<ul>
<li>what "var $form = form;" is doing</li>
<li>what parameter I should pass to doTask <strong>$form or form?</strong></li>
<li>should that first line in doTask reference $form or form</li>
<li>do I need to declare the function before calling if it is in the same file?</li>
</ul>

<p>Sorry but it's really confusing what is the difference and why the $ is there</p>
