MASSIVE LINKS株式会社
用語集一覧AI・開発

TypeScript

読み方:TypeScript

A strongly typed programming language that builds on JavaScript, developed by Microsoft. TypeScript adds static type definitions that catch errors at compile time, improving code quality and developer productivity. All valid JavaScript is valid TypeScript.

What is TypeScript

TypeScript is JavaScript with an optional type system. You declare the types of variables, function parameters, and return values. The TypeScript compiler checks these declarations and flags mismatches before the code runs.

Why TypeScript

In JavaScript, you discover type errors at runtime—when a user hits a bug. TypeScript surfaces these errors in your editor as you type. For large codebases, this is the difference between refactoring with confidence and refactoring with fear.

Basic Example

```typescript

// JavaScript — no errors until runtime

function add(a, b) {

return a + b;

}

add(1, "2"); // Returns "12", not 3

// TypeScript — caught at compile time

function add(a: number, b: number): number {

return a + b;

}

add(1, "2"); // Error: Argument of type 'string' is not assignable to 'number'

```

TypeScript Adoption

TypeScript is now the default for serious JavaScript projects. Next.js, React, and most major libraries ship TypeScript types. Most engineering teams starting a new project in 2025 choose TypeScript by default.

TypeScriptとは | 用語集 | MASSIVE LINKS株式会社 | MASSIVE LINKS株式会社