\newlinenewline logonewline logo
    • Learn

      Learn

      Learn web development from expert teachers. Build real projects, join our community, and accelerate your career

      Get Started
      Fullstack RustFullstack Node.jsFullstack D3Fullstack ReactFullstack React with TypeScriptmore →
      https://dzxbosgk90qga.cloudfront.net/fit-in/620x372/n/20220117210542194_21CB9CF5-AA2C-4939-BCC1-18F0377EFB90.png

      The newline Guide to Building Your First GraphQL Server with Node and TypeScript

      In this course, we'll show you how to create your first GraphQL server with Node.js and TypeScript

      Enroll for free
    • Teach

      Teach

      Share your knowledge with others, earn money, and help people with their career

      Apply Now
      Apply To Teach A CourseWhat Our Teachers Say
      Amelia Wattenberger

      Amelia Wattenberger

      Author of Fullstack D3

      "Writing Fullstack D3 was a thoroughly enjoyable, fun process.

      The writing was over before I knew it, and we've sold way more copies than I expected! Plus, the compliments from my peers have been really amazing."

    • Community

      Community

      Get help with programming projects, find collaborators, and make friends

      Join Now
      Join our Discord ServerListen to the PodcastWhat Our Students Say

      Featured Podcast

      A Software Engineer's Guide to Venture Capital with AngelList Engineer Sumukh Sridhara

      While many engineers work at startups or are interested in starting their own company, venture capital can seem like a total mystery. In this episode, we talk about how venture capital firms function, how VCs make money - and...

      Listen to the full episode
    • Tutorials
    Go ProLog In
     

    Beginners Guide to TypeScript

    Welcome:

    Start Here

    Chapter 1:

    Getting Started With TypeScript

    • Introduction
    • What is TypeScript?
    • JavaScript vs. TypeScript Example
    • Untyped JavaScript
    • Catching Errors with Types
    • Why Should I Use TypeScript?

    Chapter 2:

    Setting Up Your TypeScript Development Environment

    • Setting up your development environment
    • Code editor
    • Node.js and npm
    • Getting Started
    • Initialize package.json
    • Install TypeScript
    • Install ts-node
    • Initialize tsconfig.json

    Chapter 3:

    Planning Our First TypeScript Application: FinanceMe

    • Building FinanceMe
    • Planning FinanceMe
    • Example Usage
    • Class Diagram of FinanceMe

    Chapter 4:

    Classes in TypeScript: User and Expense

    • TypeScript Classes
    • Expense Class

    Chapter 5:

    Generating Unique Ids

    • Generating Unique Ids For Each Expense
    • Add genUniqueId to Expense
    • Putting It Together

    Chapter 6:

    Generating the Budget Class

    • Budget Class
    • Five New Methods
    • Category enum
    • Grouping Expenses in a Budget
    • Putting It Together

    Chapter 7:

    Tracking Expenses by Month and Users

    • TrackedMonth Class
    • User Class
    • Conclusion

    Chapter 8:

    TypeScript Language Features

    • Introduction
    • Type Alias
    • Primitive Types
    • Number
    • Number Literal Types
    • Numeric Separators
    • String
    • String Literal Types
    • Boolean
    • null and undefined
    • void

    Chapter 9:

    Lists with Arrays and Tuples

    • Arrays
    • Tuples
    • Optional Elements

    Chapter 10:

    Enums are for named constants

    • Enums
    • Enums have a value
    • Reverse Mappings

    Chapter 11:

    Typing Objects

    • Object Types
    • The object type
    • Typing object properties
    • Optional properties

    Chapter 12:

    Union Types, Discriminated Unions, and Type Guards

    • Union Types Denote "or"
    • Discriminated Unions
    • Type Guards

    Chapter 13:

    Intersection Types

    • Intersection Types Express "and"
    • Optional Properties are Optional
    • Shared Properties are Intersections

    Chapter 14:

    Typing Functions - The Basics

    • Functions
    • Annotating Functions
    • Optional Parameters
    • Default Parameters
    • Rest Parameters

    Chapter 15:

    Typing Functions with Overloading, Values, and Arrow Functions

    • Overloading
    • Functions as values
    • Arrow functions

    Chapter 16:

    Imports and Exports with TypeScript Modules

    • TypeScript Modules
    • Named Exports and Imports
    • Default Exports and Imports

    Chapter 17:

    Compiling TypeScript to JavaScript

    • Compiling to JavaScript
    • Compiler Options

    Chapter 18:

    ES2015 and TypeScript

    • ES2015
    • What We'll Cover Next

    Chapter 19:

    let and const in TypeScript

    • let and const
    • TypeScript Considerations

    Chapter 20:

    Enhanced Object Literals

    • Enhanced Object Literals
    • Shorthand for property names
    • Shorthand for method names
    • Computed property names
    • TypeScript Considerations

    Chapter 21:

    Destructuring Assignment

    • Destructuring Assignment
    • Destructuring Arrays
    • Destructuring Objects

    Chapter 22:

    Nested Destructuring

    • Nested Destructuring
    • TypeScript Considerations

    Chapter 23:

    Spread Operator

    • Spread Operator
    • Spreading Arrays
    • Spreading Objects
    • TypeScript Considerations

    Chapter 24:

    Object Oriented TypeScript

    • Introduction
    • OOP Concepts in TypeScript
    • Encapsulation
    • Information Hiding

    Chapter 25:

    Inheritance and Composition

    • Inheritance and Composition in TypeScript
    • Benefits of Inheritance
    • Where Inheritance Fails
    • Favor Composition

    Chapter 26:

    Abstraction and Polymorphism

    • Abstraction with Interfaces
    • Using Polymorphism
    • Understanding Abstract Classes
    • Conclusion

    Chapter 27:

    Object Oriented in Practice with BufferUnderflow

    • Introduction
    • Code Examples
    • Unique Entity
    • getUniqueId
    • Summary Interface
    • Using the Interfaces

    Chapter 28:

    Building Attachment and Image for BufferUnderflow

    • Modeling Attachment and Image
    • Defining Attachment
    • Defining the Image
    • Using ImageFormat
    • Understanding static
    • Building a Summary with getSummary
    • Completed Image Code
    • Using Image

    Chapter 29:

    Building the User Model

    • User.ts
    • Adding Questions and Answers
    • Getting the SUmmary
    • Permissions
    • The Finished User
    • Using the User model

    Chapter 30:

    Building the Question and Answer Models

    • Modeling Question and Answer
    • Building the Answer Model
    • Generating a Summary
    • Improving addAnswer
    • Adding Private Setters
    • Completed Answer Class
    • Defining the Question Class
    • Setting Answers

    Chapter 31:

    Running BufferUnderflow

    • The Simulation Code
    • The Output
    • Conclusion and Review

    Chapter 32:

    Introduction to TypeScript and Node.js

    • Introduction
    • Working With The File System
    • Configuring Development Environment
    • Building fs-json
    • Typed JSON files
    • Express and TypeScript
    • Configuring Development Environment

    Chapter 33:

    Building a TypeScript and Node.js App

    • Building number-app
    • The html file
    • Serving the HTML
    • Trying it out
    • Building NumInfo
    • Adding a new route
    • Handling Form Submissions
    • Using fetch
    • Conclusion

    Chapter 34:

    Where To Go From Here

    • TypeScript and React
    • TypeScript and Angular
    • TypeScript and GraphQL
    • Let us know what you think!

    Chapter 35:

    Changelog

    • Revision 3
    • Revision 2

Welcome to

Beginners Guide to TypeScript

The Beginner's Guide to Developing with TypeScript

Example Code Download

You can download the complete example code for this book by clicking here.

Table of Contents

Getting Started With TypeScript
Setting Up Your TypeScript Development Environment
Planning Our First TypeScript Application: FinanceMe
Classes in TypeScript: User and Expense
Generating Unique Ids
Generating the Budget Class
Tracking Expenses by Month and Users
TypeScript Language Features
Lists with Arrays and Tuples
Enums are for named constants
Typing Objects
Union Types, Discriminated Unions, and Type Guards
Intersection Types
Typing Functions - The Basics
Typing Functions with Overloading, Values, and Arrow Functions
Imports and Exports with TypeScript Modules
Compiling TypeScript to JavaScript
ES2015 and TypeScript
let and const in TypeScript
Enhanced Object Literals
Destructuring Assignment
Nested Destructuring
Spread Operator
Object Oriented TypeScript
Inheritance and Composition
Abstraction and Polymorphism
Object Oriented in Practice with BufferUnderflow
Building Attachment and Image for BufferUnderflow
Building the User Model
Building the Question and Answer Models
Running BufferUnderflow
Introduction to TypeScript and Node.js
Building a TypeScript and Node.js App
Where To Go From Here
Changelog
Next Chapter:
Getting Started With TypeScript

Learn

  • Fullstack React
  • ng-book
  • Fullstack D3
  • Fullstack Node.js
  • Fullstack React Native
  • Fullstack Rust

Requests

  • Request a Course
  • Request a Site Feature

Community

  • Student stories
  • Community Discord

Masterclasses

  • Tinyhouse: Fullstack React Masterclass
  • Fullstack Flask: Build a SaaS Masterclass
  • Fullstack D3 Masterclass
  • Fullstack React with TypeScript Masterclass

Shows

  • newline Podcast

Tutorials

  • React Tutorials
  • Node.js Tutorials
  • Rust Tutorials
newline

Latest Book

Fullstack React with TypeScript

Fullstack React with TypeScript

Learn this

Learn Pro Patterns for Hooks, Testing, Redux, SSR, and GraphQL

Get access to our free email tutorials

  • Terms of Service
  • Privacy
  • ©2022 Fullstack.io, LLC