What is the difference between these 2 javascript?
<p>I have been using Javascript but more in a procedural way not the object oriented way. Recently, I am just getting started to learn Javascript in a OOP manner. Can anybody tell what is the difference between:</p>

<pre><code>var foo = {
   method1 : function(){
  }
}
</code></pre>

<p>and</p>

<pre><code>var foo = function(){
   method: function(){
  }
}
</code></pre>

<p>Are both of these same or is the 1st one static class? If both are same then my 2nd question is how do I write methods and call it statically?</p>
