I am essentially trying to set a function's prototype within the function itself. The purpose is to hide many functions inside one public function, yet keep the functionality.
Here is the non-working code in a jsFiddle. The intended behaviour is displaying "Greetings!" and "Take me to your leader."
The code can be 'fixed' by moving the Outer.prototype
lines and the Extensions
function out of the Outer
function to the global scope. However, this means the Extensions
function is public and free for direct use, which it shouldn't be.
What would be a good way to achieve this 'private' behaviour?