title: javascript create function
body: <p>What is the difference between this:</p>
  
  <pre><code>var doSomething=function()
  {
      //do blah blah blah...  
  }
  </code></pre>
  
  <p>And this:</p>
  
  <pre><code>function doSomething()
  {
      //do blah blah blah...  
  }
  </code></pre>
  
  <p>Another question:
  In PHP, we create a function by doing this:</p>
  
  <pre><code>function doSomething(a,b)
  {
      //do something to variable a and b...
  }
  </code></pre>
  
  <p>In JavaScript, we may have an object before the function:</p>
  
  <pre><code>object.doSomething(a);
  </code></pre>
  
  <p>My second question is, how would you create a function which requires an object in JavaScript?</p>