In the Web Browser, all of the JavaScript code is interpreted locally on the user's machine. So for the Web Browser to be able to interpreted correctly it needs all of the source code. So the answer to your main question is "no".
The closest solution to your problem is doing some sort of obfuscation of the source code. When you do that, it makes the source code very hard for the user to read the source code, but the Web Browser can still interpret it.
To answer the last question, all objects in JavaScript can be extended like partial classes in C#.