Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Typescript

TypeScript is a strongly typed, object-oriented programming language that is designed to be compiled into JavaScript. It is a superset of JavaScript, which means that any valid JavaScript code is also valid TypeScript code.

TypeScript adds static typing to JavaScript, which means that variables must be declared with a specific type. This helps to catch errors at compile time, rather than at runtime.

let person: { name: string; age: number; isStudent: boolean } = {

    name: "John",
    age: 30,
    isStudent: true,
}
console.log(person);