0' - Exploring JS

Dr. Axel Rauschmayer

Tackling TypeScript

Upgrading from JavaScript

2

Tackling TypeScript

Dr. Axel Rauschmayer 2021

Copyright ? 2021 by Dr. Axel Rauschmayer

All rights reserved. This book or any portion thereof may not be reproduced or used in any manner whatsoever without the express written permission of the publisher except for the use of brief quotations in a book review or scholarly journal.



Contents

I Preliminaries

5

1 About this book

7

1.1 Where is the homepage of this book? . . . . . . . . . . . . . . . . . . . . 7

1.2 What is in this book? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.3 What do I get for my money? . . . . . . . . . . . . . . . . . . . . . . . . 7

1.4 How can I preview the content? . . . . . . . . . . . . . . . . . . . . . . . 8

1.5 How do I report errors? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1.6 What do the notes with icons mean? . . . . . . . . . . . . . . . . . . . . . 8

1.7 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2 Why TypeScript?

11

2.1 The benefits of using TypeScript . . . . . . . . . . . . . . . . . . . . . . . 11

2.2 The downsides of using TypeScript . . . . . . . . . . . . . . . . . . . . . 13

2.3 TypeScript myths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3 Free resources on TypeScript

15

II Getting started with TypeScript

17

4 How does TypeScript work? The bird's eye view

19

4.1 The structure of TypeScript projects . . . . . . . . . . . . . . . . . . . . . 19

4.2 Programming TypeScript via an integrated development environment (IDE) 20

4.3 Other files produced by the TypeScript compiler . . . . . . . . . . . . . . 21

4.4 Using the TypeScript compiler for plain JavaScript files . . . . . . . . . . 22

5 Trying out TypeScript

23

5.1 The TypeScript Playground . . . . . . . . . . . . . . . . . . . . . . . . . 23

5.2 TS Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

6 Notation used in this book

25

6.1 Test assertions (dynamic) . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

6.2 Type assertions (static) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

7 The essentials of TypeScript

27

7.1 What you'll learn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

7.2 Specifying the comprehensiveness of type checking . . . . . . . . . . . . 28

3

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download