Encapsulation

Encapsulation in VB.NET and JavaScript are identical at the function level. Other than the fact that you can call .toString() on a function object in JavaScript to see its source code, JavaScript functions are black boxes that hide their implementation from the caller, just like in VB.NET. There is no way to access variables or other functions declared inside a function. At the "class" level, however, JavaScript differs from VB.NET in that there is no concept of private properties or methods. If a property or method belongs to an object, it can always be accessed externally. For techniques to mimic private functions through the use of closures in JavaScript, see Writing JavaScript for the Infinity Platform.