TypeScript vs JavaScript: Same Language, One Extra Safety Net
TypeScript is JavaScript plus a type checker that runs before your code does, then disappears. In 2026 Node.js can run .ts files directly and the TypeScript 7 compiler is about 10x faster, so the cost of choosing it has never been lower.

Key takeaways
- TypeScript is a typed superset of JavaScript: any valid JavaScript is valid TypeScript, and TypeScript adds a static type checker that runs before your code and then erases the types, so the output is plain JavaScript with no type information.
- TypeScript never changes the runtime behavior of JavaScript code, which means types protect you while you write and build but cannot validate data that arrives at runtime.
- Node.js strips types by default as of v22.18.0 and v23.6.0 and made the feature stable in v24.12.0 and v25.2.0, but it does no type checking and rejects syntax that needs transformation, such as enums.
- In the 2025 Stack Overflow Developer Survey, 66% of all respondents used JavaScript and 43.6% used TypeScript, while GitHub reported TypeScript as its most used language in August 2025 with 2,636,006 monthly contributors.
- TypeScript 7.0, released July 8, 2026, is a native port that builds large codebases 8x to 12x faster, with the VS Code codebase dropping from 125.7 seconds to 10.6 seconds.
TypeScript is JavaScript with a type checker bolted on. Every valid JavaScript file is already valid TypeScript, and after the checker runs it erases the types and hands the engine plain JavaScript.[1]
So TypeScript vs JavaScript isn't a choice between two runtimes. It's a choice about whether you want a tool to catch mistakes before your users do.
I'll make the case in one line and spend the rest of the post on what changed in the last two years, because the old objections (“it needs a build step,” “the compiler is slow”) are weaker than they were.
Short version: use TypeScript for anything another person will read or that outlives a weekend, and keep plain JavaScript for scripts.
TypeScript is JavaScript plus a checker that runs before your code
The TypeScript handbook puts it as “JavaScript's runtime with a compile-time type checker.” JavaScript itself is, in MDN's words, “a lightweight interpreted (or just-in-time compiled) programming language” that is a dynamic language, so it finds out what a value is while the program runs.[1,4]
If you want the longer history of how the two languages differ from Java, that's in Java and JavaScript are not the same.
TypeScript moves some of that discovery earlier. The handbook's own example is a typo that JavaScript happily runs and then fails on, and TypeScript flags in the editor.[1]
const obj = { width: 10, height: 15 };
const area = obj.width * obj.heigth; // Typo: "heigth"
// TypeScript:
// Property 'heigth' does not exist on type
// '{ width: number; height: number; }'. Did you mean 'height'?Plain JavaScript would give you NaN here, silently, somewhere far from the typo. That's the entire value proposition, and it's a good one.
The types vanish, so they can't protect you at runtime
This is the part most “TypeScript vs JavaScript” posts skip.
Once the compiler finishes checking your code, it “erases the types to produce the resulting ‘compiled’ code,” and the handbook says outright that the resulting JavaScript “has no type information.”[1] It also states the design principle: TypeScript “never changes the runtime behavior of JavaScript code.”[1]
What happens to a .ts file
The checker reads your types. The engine never sees them.
What you write
- TypeScript sourceJavaScript plus type annotations
- tsconfig.jsonWhich checks to turn on
tsc or Node.js type stripping
Check, then erase the types
What actually runs
- Plain JavaScriptSame behavior, no type information
- Any browser or Node.js engine
A type is a promise you made at build time. It isn't a guard at runtime.
What that means in practice: if your server receives JSON from the network, TypeScript can tell you what you expect it to contain, and it has no way to check what actually arrived.
I read that as the honest limit of the tool. A type says what you promised, not what showed up. Teams that forget this ship user.email.toLowerCase() to production and are surprised when a missing field takes it down.
The other consequence is nicer. Because the checker is separate from the output, it doesn't get in your way.
TypeScript still emits JavaScript when it finds a type error, which the handbook frames as a core value: “much of the time, you will know better than TypeScript.” If you'd rather it refuse, the noEmitOnError option does that.[3]
Side note
You don't need a build step for it anymore
The strongest old argument for plain JavaScript was the toolchain: to run TypeScript you had to compile it first. Node.js changed that. Per its docs, type stripping is on by default in v23.6.0 and v22.18.0 and became stable in v25.2.0 and v24.12.0. Node “will replace TypeScript syntax with whitespace, and no type checking is performed.”[5]
There are two catches, and both are in the docs. Node doesn't check anything, so you still run tsc or your editor for the checking.
And features that need transformation, not just deletion, “will error”: enum declarations, namespaces with runtime code, parameter properties, and import aliases.[5] The erasableSyntaxOnly compiler option in the recommended config makes the editor flag the same syntax Node would reject.[5]
JavaScript is still more used, and TypeScript is still ahead on GitHub
Both of those are true, and the gap comes from what each source counts. In the 2025 Stack Overflow Developer Survey, JavaScript was used by 66% of all respondents (first place) and TypeScript by 43.6% (sixth).[8]
GitHub's Octoverse report said TypeScript became the most used language on the platform in August 2025, with 2,636,006 monthly contributors, a 66.6% jump in a year, passing Python by about 42,000.[9]
GitHub says why: frameworks that scaffold new projects in TypeScript by default, and AI-assisted development that “benefits from stricter type systems.”[9] It also warns that “other industry indices use different methodologies and may still rank JavaScript and Python higher.”[9] Take both numbers, trust neither as a verdict.
My read is that new projects default to TypeScript now, while the long tail of existing JavaScript keeps its survey lead.
The compiler is about ten times faster
The other classic complaint was speed. On March 11, 2025 the TypeScript team announced a native port of the compiler, which reported 77.8 seconds to 7.5 seconds on the VS Code codebase.[7]
TypeScript 7.0, released July 8, 2026, is that port as the main release, written in Go, installed with npm install -D typescript.[6] The team's own table for full builds:
TypeScript 6
TypeScript 7
- VS Code125.7s10.6s
- Sentry139.8s15.7s
- Bluesky24.3s2.8s
- Playwright12.8s1.47s
Takeaway
The speed objection to TypeScript is mostly gone: the VS Code codebase builds in 10.6 seconds instead of 125.7. Upgrading isn't free, though. Version 7 turns strict on by default and makes options deprecated in 6.0, such as target: es5, hard errors.
Read the known gaps before you upgrade a framework project. There is no stable programmatic API in 7.0 (the team expects one in 7.1), and tools that embed TypeScript for Vue, MDX, Astro, Svelte, and Angular templates still need 6.0 for editor support.[6]
When plain JavaScript is still the right call
I'll argue against myself for a minute. TypeScript costs you configuration, a second thing to keep in sync with your dependencies, and type gymnastics that sometimes take longer than the bug they prevent. Advanced type patterns are powerful and also how a team ends up debugging types instead of products. Here is how I'd weigh it.
| Situation | Lean toward | Why |
|---|---|---|
| A one-file script or a prototype | JavaScript | Nothing to configure, and you hold the whole program in your head. |
| An app with more than one contributor | TypeScript | The checker documents what functions expect and flags callers that break. |
| A library other people import | TypeScript | Editors use your types to autocomplete and warn your users. |
| An existing JavaScript codebase | Migrate gradually | Your JavaScript is already TypeScript, so you can add types file by file. |
The last row follows from the handbook: existing working JavaScript is also TypeScript code.
That last row is the reason I stopped treating this as a rewrite decision. The TypeScript docs say your existing working JavaScript is “also TypeScript code,” so you can rename one file and start there.[2] If you want the compile-or-interpret background behind all of this, see compiled vs interpreted languages.
Pick a file you're scared to touch, rename it to .ts, and read what the checker says. That first red squiggle is usually a bug you didn't know about.
Sources and further reading
- 1.PrimaryTypeScript handbook, "TypeScript for the New Programmer". Typed superset, type checking before execution, erased types, and the never-changes-runtime-behavior principle.
- 2.PrimaryTypeScript handbook, "TypeScript for JavaScript Programmers". Existing working JavaScript code is also TypeScript code; type annotations and structural typing.
- 3.PrimaryTypeScript handbook, "The Basics". Static type-checking, emitting with errors, and the noEmitOnError option.
- 4.PrimaryMDN Web Docs, "JavaScript". Definition of JavaScript as a lightweight, interpreted or JIT-compiled, dynamic language.
- 5.PrimaryNode.js documentation, "Modules: TypeScript". Type stripping versions, no type checking, unsupported transform-only syntax, and erasableSyntaxOnly.
- 6.PrimaryTypeScript team, "Announcing TypeScript 7.0". July 8, 2026. Native Go port, full-build times against TypeScript 6, breaking changes and known gaps.
- 7.PrimaryTypeScript team, "A 10x Faster TypeScript". March 11, 2025. Announcement of the native port with the VS Code 77.8s to 7.5s benchmark.
- 8.DataStack Overflow, "2025 Developer Survey: Technology". JavaScript 66% and TypeScript 43.6% among all respondents.
- 9.DataGitHub, "Octoverse: A new developer joins GitHub every second as AI leads TypeScript to #1". TypeScript at 2,636,006 monthly contributors in August 2025, methodology caveat, and reasons for the shift.
- 10.PrimaryTC39, "Proposal: Type Annotations". Stage 1 proposal to treat type annotations as comments in JavaScript.
Frequently asked questions
- What is the main difference between TypeScript and JavaScript?
- TypeScript adds a static type system on top of JavaScript, and JavaScript does not have one. A type checker reads your TypeScript before it runs and reports mistakes, such as calling a property that doesn't exist, then erases the types and outputs plain JavaScript. Browsers and Node.js only ever run JavaScript.
- Is TypeScript better than JavaScript?
- For shared or long-lived code, usually yes, because the checker catches a class of bugs before they ship. For a small script, a prototype, or a project where you want no build tooling, plain JavaScript is simpler and loses little. TypeScript is a layer on JavaScript, so the real choice is whether the checker is worth its setup for your project.
- Is TypeScript faster than JavaScript?
- No. TypeScript compiles to JavaScript and never changes runtime behavior, so the running code performs the same as hand-written JavaScript. What got faster is the compiler: TypeScript 7.0, released July 8, 2026, builds large projects about 8x to 12x faster than TypeScript 6.
- Can Node.js run TypeScript without compiling?
- Yes, for erasable syntax. Node.js 22.18.0 and 23.6.0 turned on type stripping by default, and it became stable in 24.12.0 and 25.2.0. Node replaces the type annotations with whitespace and runs the file, but it performs no type checking and errors on features that need transformation, such as enum declarations.
- Do I need to learn JavaScript before TypeScript?
- Yes, in practice. TypeScript is a superset of JavaScript, so every TypeScript program is a JavaScript program once the types are removed, and the runtime behavior, libraries, and quirks are all JavaScript's. Learn the JavaScript first, then add the types.
Written by
Tech Talk News Editorial
Computer engineering background. Writes about software, AI, markets, and real estate, and the places where the three meet.
More about the author