APPENDIX 1

image

JavaScript Quick Reference

If you aren’t already familiar with JavaScript, this quick reference is intended to provide an overview of the basic core features of JavaScript you’ll be using within a TypeScript program.

Variables

Variables are used to store the application’s state in JavaScript and can contain data of any type from strings to numbers to objects to functions.

Listing A1-1 shows a selection of variables with simple types. Variables can be assigned at the same time as they are declared, in a single statement, or they can be declared and assigned separately. A variable will have the type corresponding to the value that was ...

Get Pro TypeScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.