Share E-Book

TypeScript Programming Language (TypeScript Publishing)(Z-Library)

Author TypeScript Publishing

Web Technology
Language English

TypeScript lets you write JavaScript the way you really want to. TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. TypeScript is pure object oriented with classes, interfaces and statically typed like C# or Java. The popular JavaScript framework Angular is written in TypeScript. Mastering TypeScript can help programmers to write object-oriented programs and have them compiled to JavaScript, both on server side and client side. This is a book for programmers of all walks: professional JavaScript engineers, C# people, Java sympathizers, Python lovers, Ruby aficionados, Haskell nerds. Whatever language(s) you write in, so long as you have some experience programming and know the basics of functions, variables, classes, and errors, this book is for you. Some experience with JavaScript, including a basic knowledge of the Document Object Model (DOM) and the network, will help you along the way while we don’t dive deep into these concepts, they are a wellspring of excellent examples, and if you’re not familiar with them the examples might not make as much sense. Regardless of what programming languages you’ve used in the past, what unites all of us is our shared experience of tracking down exceptions, tracing through code line by line to figure out what went wrong and how we can fix it. This is the experience that TypeScript helps prevent by examining your code automatically and pointing out the mistakes you may have missed. It’s OK if you haven’t worked with a statically typed language before. I’ll teach you about types and how to use them effectively to make your programs crash less, document your code better, and scale your applications across more users, engineers, and servers. I’ll try to avoid big words when I can, and explain ideas in a way that’s intuitive, memorable, and practical, using lots of examples along the way to help keep things concrete. That’s the thing about TypeScript: unlike a lot of other typed languages, TypeScript is

Format EPUB
Size 4.8 MB
168
Views
0
Downloads
0.00
Total Donations

AI Guide

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

Full assistant
AI guide
【One-Line Pitch】 A practical, example-driven introduction to TypeScript for programmers who already know how to code but want fewer runtime crashes, better tooling, and a path from JavaScript chaos to application-scale structure. Best for working developers coming from JavaScript, C#, Java, Python, or any typed/untyped background who want types explained without academic jargon. 【Book Arc】 - **Opening (~0%–9%)**: Frames why TypeScript exists — JavaScript's growth into server-side and enterprise work exposed its lack of strong typing, compile-time checks, and object orientation. Introduces TypeScript as a typed superset that compiles to plain JavaScript, and previews the full table of contents from setup through types, variables, operators, loops, and functions. - **Early (~15%–33%)**: Establishes the language's identity and toolchain. Covers TypeScript's relationship to ECMAScript, its portability across browsers/devices/OSes, and the practical setup path: online Playground, text editors, the TSC transpiler, Node.js installation on Windows/Mac/Linux, and IDE support including Visual Studio Code and Brackets. - **Middle (~39%–52%)**: Moves into core language mechanics. Basic syntax, comments, and object-oriented foundations (classes, objects, methods) lead into the type system: the `any` supertype, built-in types like number/string/boolean/void/null/undefined, variable declaration patterns, type assertion, and inferred typing. This is where the book's central promise — strong typing that catches assignment errors at compile time — becomes concrete. - **Late (beyond ~52%)**: The excerpts thin out here. Based on the table of contents, later material covers operators, decision making, loops, and functions (positional, optional, rest, default, anonymous), plus object-oriented features like interfaces and classes, and ambient declarations. The excerpts do not cover these chapters in detail. 【Key Takeaways】 - **TypeScript is JavaScript plus a compile-time safety net** (Early): It starts and ends as JavaScript, so existing libraries, frameworks, and tools remain usable. The value is catching syntax and type errors before runtime, not replacing the ecosystem. - **The compiler is a transpiler, not a runtime** (Early): TSC converts `.ts` and `.d.ts` files into equivalent JavaScript targeting ECMAScript 3 or newer. It rejects raw `.js` input, which clarifies that TypeScript is a development-time layer, not a new execution environment. - **Strong typing is optional but powerful** (Middle): Variables can be explicitly typed, inferred from their value, or left as `any` to opt out of checking. This flexibility lets teams adopt types gradually rather than rewriting everything at once. - **Type assertion is a compile-time hint, not runtime casting** (Middle): The `<number><any>str` pattern tells the compiler how to analyze a value; it does not change the value at runtime. Understanding this distinction prevents false expectations about what assertions can do. - **Object orientation is first-class** (Middle): Classes, objects, methods, state, behavior, and identity are supported directly, with compiled output using JavaScript's prototype pattern. This makes TypeScript approachable for developers from C#, Java, or similar backgrounds. - **Setup is deliberately low-friction** (Early): The Playground, npm-installed compiler, and VS Code integration mean you can start experimenting in minutes. The book walks through Windows, Mac, and Linux paths so environment issues don't block learning. - **The type system supports documentation and scale** (Middle): Beyond error prevention, types enable richer code hinting and automated documentation, which matters as applications grow across more engineers and servers. - **Null and undefined are a known confusion point** (Middle): The book flags them explicitly as a common source of misunderstanding, signaling that careful handling of absent values is part of writing reliable TypeScript. 【Reading Tips】 - **Skim the setup chapter if you already have Node and an editor**: The installation steps for Windows, Mac, and Linux are useful for beginners but can be skipped by experienced developers who just need the `npm install -g typescript` command. - **Deep-read the types and variables sections**: These are the conceptual core. Pay attention to the difference between explicit typing, inferred typing, and `any`, and to why type assertion is compile-time only. - **Use the Playground alongside the book**: The online editor shows emitted JavaScript in real time, which makes the transpilation model tangible and helps you see what TypeScript adds and what it erases. - **Treat the OOP chapter as a bridge, not a destination**: If you come from a class-based language, the syntax will feel familiar; focus on how TypeScript's classes compile down to JavaScript prototypes. - **Expect the later chapters to carry more weight than the excerpts show**: Operators, loops, functions, interfaces, and ambient declarations are listed in the contents but not detailed in the available excerpts, so plan to read them in the full book. 【Coverage Limits】 This guide is based on stratified excerpts covering roughly the first half of the book, with the later chapters on operators, loops, functions, interfaces, and ambient declarations only visible through the table of contents. The excerpts do not cover those chapters in detail, so this guide's treatment of advanced TypeScript features is necessarily thin.

Passage locations

Excerpt 1
your applications across more users, engineers, and servers. I’ll try to avoid big words when I can, and explain ideas in a way that’s intuitive, memorable,...
View in text
Excerpt 2
tems. It can run on any environment that JavaScript runs on. Unlike its counterparts, TypeScript doesn’t need a dedicated VM or a specific runtime environmen...
View in text
Excerpt 3
n Windows: Step 1 − Download Visual Studio Code for Windows. Step 2  − Double-click on VSCodeSetup.exe   to launch the setup process. This will only take a m...
View in text
Excerpt 4
d the  undefined  datatypes are often a source of confusion. The null and undefined cannot be used to reference the data type of a variable. They can only be...
View in text

Recommended for You

Loading recommended books...
Failed to load, please try again later

Tip the Site

Scan the WeChat Pay or Alipay code to tip. No login required.

WeChat Pay
Alipay
Back to List