शब्दकोश · प्रोग्रामिंग

TypeScript

TypeScript is a typed superset of JavaScript from Microsoft that adds static types and compiles to plain JavaScript for browsers and Node.js.

अपडेट: अक्टूबर 6, 2026

TypeScript is a programming language developed by Microsoft that adds optional static types to JavaScript. Every valid JavaScript program is also valid TypeScript, and the TypeScript compiler checks types and then emits plain JavaScript that runs in browsers or on Node.js.

Why it matters

Types catch many mistakes, such as misspelled properties or wrong argument types, before the code runs, and they give editors accurate autocomplete and safe refactoring. This is valuable in large front-end and Node.js codebases with many contributors. Types exist only at compile time and are erased in the output, so they do not validate data arriving at runtime, such as an API response.

Example

interface Site {
  host: string;
  up: boolean;
}

function label(s: Site): string {
  return s.up ? `${s.host} is up` : `${s.host} is down`;
}

label({ host: "example.com", upp: true }); // compile error: 'upp'

The misspelled property is flagged before the code is ever executed.

Common mistakes

  • Overusing any, which switches off type checking.
  • Assuming a type annotation validates untrusted JSON at runtime.
  • Casting with as to silence errors instead of fixing the underlying mismatch.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.