[{"data":1,"prerenderedAt":29},["ShallowReactive",2],{"$f0z2WvwJ1ry0s8THkhuePIdvLs26wEVskWNXeyevZnRA":3},{"slug":4,"title":5,"description":6,"date":7,"tags":8,"draft":13,"readingMinutes":14,"html":15,"related":16},"typescript-vs-javascript","TypeScript vs JavaScript in 2026: When I'd Still Skip the Types","TypeScript vs JavaScript from a developer who writes both: what types catch, what they cost, Node running .ts files directly, and when plain JS is the right call.","2026-11-21",[9,10,11,12],"typescript","javascript","node","frontend",false,4,"\u003Cp>TypeScript or JavaScript? For anything that will have more than one developer, live longer than a few months, or get written partly by an AI assistant, I&#39;d use TypeScript. For a 200-line script, a quick prototype you&#39;ll throw away, or a codebase where nobody wants to learn it, plain JavaScript is fine and I won&#39;t pretend otherwise.\u003C/p>\n\u003Cp>That&#39;s the short answer. The longer one is mostly about what changed in the last two years, because a lot of the old arguments against TypeScript don&#39;t hold anymore.\u003C/p>\n\u003Ch2>What TypeScript actually is\u003C/h2>\n\u003Cp>TypeScript is JavaScript with type annotations. You write \u003Ccode>function total(items: Item[]): number\u003C/code>, a checker reads the whole project and tells you when something doesn&#39;t fit, and then the types are stripped out. What runs in the browser or in Node is plain JavaScript. There&#39;s no TypeScript runtime and no speed difference at runtime, in either direction.\u003C/p>\n\u003Cp>So the comparison isn&#39;t &quot;which language is faster&quot; or &quot;which one can do more&quot;. It&#39;s &quot;do you want a checker reading your code before it ships, and what does it cost you to have one&quot;.\u003C/p>\n\u003Ch2>What it catches\u003C/h2>\n\u003Cp>The boring stuff, and that&#39;s the point. A misspelled property. A function that can return \u003Ccode>undefined\u003C/code> being used as if it can&#39;t. An API response that changed shape. A refactor that renamed a field in 30 files and missed two.\u003C/p>\n\u003Cimg src=\"/blog/typescript-vs-javascript/where-the-typo-surfaces.webp\" alt=\"Timeline of one misspelled property: TypeScript flags it in the editor, plain JavaScript lets it reach production and a customer\" width=\"1600\" height=\"900\" loading=\"lazy\">\u003Cp>In plain JavaScript, \u003Ccode>user.emial\u003C/code> is just \u003Ccode>undefined\u003C/code>. Nothing complains. You find out when a welcome email goes to nobody, maybe days later, maybe from a customer. In TypeScript the editor underlines it the second you type it. That one class of bug, multiplied over a codebase, is most of the value.\u003C/p>\n\u003Cp>The second big win is reading code you didn&#39;t write. When I open a project and see \u003Ccode>createInvoice(customer: Customer, lines: InvoiceLine[], opts?: { draft?: boolean })\u003C/code>, I know what to pass without opening three other files. That matters a lot when the codebase was written by someone else and they&#39;re no longer around to ask.\u003C/p>\n\u003Ch2>What it costs\u003C/h2>\n\u003Cp>A build step, used to be the main complaint. That&#39;s mostly gone. Vite, Nuxt, Next, Bun and Deno all take \u003Ccode>.ts\u003C/code> files without any setup. And Node itself now runs TypeScript files directly by stripping the types: \u003Ccode>node server.ts\u003C/code> works on current versions, including Node 26, which became the LTS line on October 28, 2026. It doesn&#39;t type-check when it does that, it just removes the annotations, so you still run \u003Ccode>tsc --noEmit\u003C/code> in CI. But you no longer need \u003Ccode>ts-node\u003C/code> or a compile step to start a server.\u003C/p>\n\u003Cp>Speed was the other complaint, on big projects. TypeScript 7 is the compiler Microsoft rewrote in Go, and npm shows \u003Ccode>typescript\u003C/code> at 7.0.2 now. On a large codebase the type check that used to make you wait now mostly doesn&#39;t.\u003C/p>\n\u003Cp>What&#39;s left is the real cost: time spent on types themselves. Generic utility types, fighting a library with bad type definitions, \u003Ccode>as unknown as Whatever\u003C/code> to get past something you know is fine. On a small team with a deadline that can eat hours. My rule is to type the edges (API responses, function signatures, database rows) properly and be relaxed inside a function. \u003Ccode>strict: true\u003C/code> stays on, \u003Ccode>any\u003C/code> is allowed with a comment saying why.\u003C/p>\n\u003Ch2>AI tools changed the math\u003C/h2>\n\u003Cp>This is the argument I find most convincing in 2026. When an AI assistant writes a chunk of your code, the type checker is the cheapest reviewer you have. The assistant invents a field that doesn&#39;t exist, or calls your function with arguments in the wrong order, and \u003Ccode>tsc\u003C/code> catches it before a human has to. Most assistants also write better code when they can see types, because the types tell them what your data looks like without guessing.\u003C/p>\n\u003Cp>In plain JavaScript the same mistakes slip through until something runs. If you&#39;re building with Cursor, Copilot or anything like it, I&#39;d treat TypeScript as close to required.\u003C/p>\n\u003Ch2>Popularity, if you care\u003C/h2>\n\u003Cp>npm counted about 451 million downloads of the \u003Ccode>typescript\u003C/code> package in the week of November 13 to 19, 2026. For comparison, React had about 275 million that week. Download numbers include every CI run, so they mostly say &quot;TypeScript is in almost every serious JavaScript project&#39;s toolchain&quot;, which matches what I see in client code.\u003C/p>\n\u003Cp>For hiring, it means most JavaScript developers already know TypeScript. You&#39;re not narrowing the pool much by requiring it.\u003C/p>\n\u003Ch2>When I&#39;d still pick plain JavaScript\u003C/h2>\n\u003Cul>\n\u003Cli>A small script: a one-off data migration, a cron job that hits one API, a build helper.\u003C/li>\n\u003Cli>A prototype you&#39;ll genuinely throw away. Be honest about that, because most &quot;throwaway&quot; prototypes end up in production.\u003C/li>\n\u003Cli>An existing JavaScript codebase that works and isn&#39;t changing much. Rewriting it to TypeScript for its own sake is rarely worth it. Add \u003Ccode>// @ts-check\u003C/code> and JSDoc types to the files you touch and get most of the editor help for free.\u003C/li>\n\u003Cli>A team that doesn&#39;t want it. Forcing TypeScript on people who will fill it with \u003Ccode>any\u003C/code> gives you the cost and none of the benefit.\u003C/li>\n\u003C/ul>\n\u003Ch2>Moving an existing project over\u003C/h2>\n\u003Cp>Don&#39;t do it in one go. Rename one file at a time, starting with the ones that hold your data shapes (API clients, database models), turn on \u003Ccode>allowJs\u003C/code> so both live side by side, and tighten \u003Ccode>strict\u003C/code> once most files are converted. The order matters more than the speed: types on the data first, UI last.\u003C/p>\n\u003Cp>If you&#39;ve got a JavaScript or half-typed codebase and want someone to get it into shape, or an app that needs a developer who can read what&#39;s already there, \u003Ca href=\"https://calendly.com/director-norsky/meeting\">book a free call\u003C/a>. All consultation is free.\u003C/p>\n",[17,21,25],{"slug":18,"title":19,"description":20},"nextjs-vs-react","Next.js vs React: You're Choosing a Server, Not a Library","Next.js vs React in November 2026: what Next adds on top of React 19, when plain React with Vite is the better start, and the cost nobody mentions.",{"slug":22,"title":23,"description":24},"vite-vs-webpack","Vite vs Webpack: Which One I'd Start a Project On","Vite vs Webpack in November 2026: Vite 8 on Rolldown, webpack 5 still everywhere, what changes in dev and build, and when moving an old app is worth it.",{"slug":26,"title":27,"description":28},"pnpm-vs-npm","pnpm vs npm: Which One I'd Pick for a New Project","pnpm vs npm in November 2026: disk use, install speed, strict node_modules, build scripts, release-age delays and monorepos, and when switching is worth it.",1795910046915]