How to add functions to prototype of inner function in the global scope in JavaScript?
<pre><code>function A() {  
    this.B = function() {  
        var bla;
    };
}
A.B.prototype.foo = function() {console.log("Do whatever");};
</code></pre>

<p>I get this:  </p>

<blockquote>
  <p>TypeError: Cannot read property 'prototype' of undefined</p>
</blockquote>

<p>How to add a function to the prototype of B in this case? </p>
