what are the advantages and disadvantages of anonymous methods in javascript?
<p>in javascript there are so many different ways to set up a method for something such as a button click event.</p>

<p>for example say you have retreived an input element 'button'</p>

<pre><code>function MyForm(){
   //anonymous method
   button.click = function(){ //work };


   //private method
   var handleClick = function () { // work };
   button.click = handleClick;

   //public method
   button.click = outerClickHandle;


}

//public
function outerClickHandle(){
    // work
}

//prototype
MyForm.prototype.outerClickProto(){
   //work
}
</code></pre>

<p>there are of course some of the more obvious answers such as encapsulation when desired. And with the prototype you don't have to recreate that function each time which is good for performance, but as for anonymous methods, other than being a nice way, or flow of writing the script, what is good and bad?</p>
