What TypeScript is

suggest change

TypeScript adds static type checking to JavaScript. Type annotations are checked during development and erased from emitted JavaScript; inferred types do not change how values behave at runtime. Some TypeScript syntax, such as enums and parameter properties, does emit JavaScript.

Type inference means annotations are most useful at API boundaries. Local values often need no explicit type.

const language = "TypeScript";

function greeting(name: string): string {
  return `Hello, ${name}!`;
}

const message = greeting(language);
console.log(message);

Type checking does not validate data received at runtime. Parse and validate input from files, users, and network requests before treating it as a trusted type.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents