title: JavaScript function different syntax?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong>
    <a href="https://stackoverflow.com/questions/1013385">What is the difference between a function expression vs declaration in JavaScript?</a>
    <a href="https://stackoverflow.com/questions/3245639">This JavaScript syntax I haven't seen till now, what does it do really?</a></p>
  </blockquote>
  
  
  
  <p>What is the difference between the following two ways of writing a function? I've seen both used, but I'm not sure which one is 'correct'.</p>
  
  <pre><code>function init() {
  
  }
  
  
  init: function() {
  
  },
  </code></pre>
  
  <p>And what are the advantages to writing it the second way?</p>