Skip to content
Home Tutorials Roadmaps Courses Classroom Training Blog
Log in Join free
TypeScript Intermediate Free

What is TypeScript?

Lesson 1 of 17 · Getting Started 6%

TypeScript is a strongly typed programming language that builds on JavaScript. It adds static type checking to help catch errors early.

TypeScript is developed by Microsoft and is widely used in large-scale applications.

Why TypeScript?

  • Catches errors at compile time
  • Better IDE support and autocompletion
  • Great for large codebases
  • Compiles to plain JavaScript

Syntax

TYPESCRIPT
let message: string = "Hello, TypeScript!";
let count: number = 42;
let isActive: boolean = true;

function greet(name: string): string {
    return `Hello, ${name}!`;
}
TypeScript Hello World
TYPESCRIPT
let message: string = "Hello, TypeScript!";
console.log(message);

let count: number = 42;
let isActive: boolean = true;

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

console.log(greet("SukhNexus"));

Practice

1
Exercise

What is the main benefit of TypeScript over JavaScript?

Answer
Static type checking — catches errors at compile time.

Quick Quiz

1

What does TypeScript compile to?

TypeScript compiles to plain JavaScript that runs in any browser.

Choose an answer to continue.

Interview Questions

TypeScript adds static type checking and compiles to JavaScript. JavaScript is dynamically typed.

Up next

Types & Interfaces

Lesson 2 of 17 · Basic Types