TypeScript is a superset of JavaScript that compiles to JavaScript. It adds optional static typing, classes, and interfaces to JavaScript to help catch errors. TypeScript code is converted to JavaScript at compile time. There are three versions of ECMAScript that TypeScript works with - ES3, ES5, and ES6. TypeScript allows for both static and dynamic typing through features like type declarations and generics.