+ - 0:00:00
Notes for current slide
Notes for next slide

Typescript Fundamentals

Sample code is available in codes/javascript-code-samples.js

By: Vahid Mohammadi

Created with: RemarkJS
1 / 6

Some JavaScript Tips

  • Don't use var. Use const or let instead
  • Use array methods: forEach, map, reduce, filter, slice, find, findIndex, includes, some, every
  • Mutation
  • Use backticks
  • Use destructing
2 / 6

Getting Started With Typescript

Things to note:

  • npm i typescript and tsc command
  • Configuration: tsconfig.json
    • files, include, exclude
    • extends
    • CompilerOptions:
    • baseUrl
    • paths
    • strict flags
    • noUnusedLocals
    • noUnusedParameters
3 / 6

Basic Types

4 / 6

Generics

  • Makes types, interfaces, functions and class generic
  • default type: function func<T = string>(arg: T): T {}
  • extends type: function func<T extends any[]>(arg: T) {}
5 / 6

TSLint & ESLint

  • tslint.json and .eslintrc configuration files
  • IDE extentions: Install eslint and tslint extension
  • Codelyzer
6 / 6

Some JavaScript Tips

  • Don't use var. Use const or let instead
  • Use array methods: forEach, map, reduce, filter, slice, find, findIndex, includes, some, every
  • Mutation
  • Use backticks
  • Use destructing
2 / 6
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow