Skip to content
AgileLogics
4 min read

What Is TypeScript?

TypeScript is JavaScript with an added type system — you describe what kind of values a variable, parameter, or return value should be, and a separate tool (the TypeScript compiler) checks your whole program for mismatches before it ever runs.

function add(a: number, b: number): number {
    return a + b;
}

add(2, "3"); // caught before running:
// Argument of type 'string' is not assignable to parameter of type 'number'

That error is caught the moment you save the file (in an editor with TypeScript support) or run the compiler — the equivalent plain JavaScript would only fail at runtime, if you were unlucky enough to hit that exact code path.

TypeScript compiles down to plain JavaScript — browsers and Node never run TypeScript directly, they run the JavaScript it produces. The type system exists entirely to help you while writing the code; it adds no runtime behavior of its own.