TypeScript is an open source lanaguage from Microsoft that solves this problem by introducing an optional type system and class-based object-orientation, which make great tooling for large applications possible.

TypeScript let's you write JavaScript that is robust enough for the enterprise and that can run in any browser, on any host and on any operating system.