Js oop design pattern function difference ? : <p>type 1</p>

<pre><code>  this.toString = function () {

  };
</code></pre>

<p>type 2</p>

<pre><code>   myPublicMethod: function () {

    }
</code></pre>

<p>type3</p>

<pre><code>  var myPrivateMethod = function () {

    }
</code></pre>

<p>type4</p>

<pre><code>Y.store.basket = (function () {

})();
</code></pre>

<p>i am studying JS oop design pattern , i have this all kind of function which is confuse me , what the difference btw this all this function , type 2 and type 3 which is public and private ?</p>
