App Masters

App Masters

  • English
  • Português

›Javascript Fundamentals

App Masters - Core

  • Home
  • Content

Backend

  • Node Express
  • Node Worker Threads

Database

  • GraphQL

Javascript Fundamentals

  • Asynchronous Javascript
  • Typescript

Design Patterns

  • Presentational Container Design Pattern

Frontend

  • AMP (Accelerated Mobile Pages)
  • Bubblewrap
  • Gatsby.js
  • Next.js
  • PWA
  • Styled Components

Mobile

  • React Native
  • Store Testing

Server

  • Netlify

Testing

  • Cypress
  • Jest

Design

  • Human Interface
  • Material Design

Tools

  • Bitrise
  • Docker

Typescript

What is

Basically, it's JavaScript with types. This simple idea may make it seem like TypeScript don't do that much, but don't fool yourself: it adds a lot of control over JavaScript to the code, avoiding errors that lack of types usually brings.

The greatest practicality that typescript brings is being able to move the cursor over a variable or function, and to know exactly its return, making it much easier to deduce its usability.

How to use

Basic types

  • boolean
  • number
  • string
  • array
  • tuple
  • enum
  • any

The type any is usually assigned when the typescript cannot identify the typing, but can also be assigned manually. It is not recommended to leave the type as any. Defining exactly the types helps not only typescript, but also the programmer to better understand the code.

Specific types

If your variable doesn't fit the basic types, you can create an interface where you configure your object.

If your variable comes from a package, Typescript may not be able to assign its type. In such cases, the package usually has a type library.

How to learn

Useful material

  • Typescript handbook
  • Typescript playlist
  • Video React with typescript crash course

Validating knowledge

  • A very simple way to validate knowledge in typescript, is to take a code in javascript and adapt it to typescript

Useful commands

  • npm install typescript --save-dev - installs typescript via npm
← Asynchronous JavascriptPresentational Container Design Pattern →
  • What is
  • How to use
    • Basic types
    • Specific types
  • How to learn
    • Useful material
    • Validating knowledge
  • Useful commands
App Masters
App masters
Content
More
BlogGitHub
Copyright © 2022 App Masters