TypeScript extends JavaScript with static type checking to catch errors at compile-time rather than runtime, preventing costly production bugs while maintaining full JavaScript compatibility.
TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale. Developed by Microsoft and introduced to the public in October 2012, it is maintained as an open-source project at https://github.com/microsoft/TypeScript. TypeScript is a superset of JavaScript, meaning that everything available in JavaScript is also available in TypeScript, and that every JavaScript program is a syntactically legal TypeScript program.
To install TypeScript, run npm install -g typescript for global installation, or install TypeScript compiler locally in your project (npm install --save-dev typescript). This will install the latest version (currently 5.9). After installation, initialize a new TypeScript configuration file with tsc --init, which creates a tsconfig.json file in your project directory that specifies the compiler options for your project. The compiler is invoked with tsc helloworld.ts, which transpiles the TypeScript file into vanilla JavaScript.
TypeScript code converts to JavaScript, which runs anywhere JavaScript runs: In a browser, on Node.js, Deno, Bun and in your apps. By default, TypeScript does not verify types at runtime in order to avoid runtime overhead and aggressively optimize runtime performance as a part of its design goals. TypeScript only performs static type checking at compile time! The generated JavaScript, which is what actually runs when you run your code, does not know anything about the types. The primary alternatives to TypeScript include Flow, a static type checker for JavaScript developed by Facebook, and JSDoc, a markup language used to annotate JavaScript source code files, allowing programmers to add documentation describing the application programming interface of the code they're creating. JSDoc does not require any compilation step as they are just 'comments', which is a supported feature of Javascript itself, which can simplify and increase the speed of development workflow compared to using the necessary Typescript build pipeline.
TypeScript adds static type checking to JavaScript, enabling compile-time error detection while maintaining full JavaScript compatibility.
Want research like this for any video?
Save a link, get back verified intelligence.