title: Adding a prototype to an object constructor defined in an object literal
body: <p>Hey so I have an object constructor method inside and object literal, and I defined a prototype for the constructor like this </p>
  
  <pre><code>objectLiteralKey:(function()
  {
      var f=function()
      {
          ...
      };
  
      f.prototype=ObjectInstance;
  
      return f;
  }()),
  //inside an object literal
  </code></pre>
  
  <p>is there any reason this pattern of defining the prototype should be avoided? or perhaps another way thats better somehow?</p>
  
  <p>EDIT: by the way the object literal is within a self invoking function which holds the laserPrototype, I put it there because there is another "enemy" that requires the same prototype</p>
  
  <p>full code <a href="http://jsfiddle.net/m2DwT/" rel="nofollow">http://jsfiddle.net/m2DwT/</a></p>