Is TypeScript Right for you?

Erica Mitchell

emitchell@cardinalsolutions.com

http://slides.com/ericamitchell/cardinalts/fullscreen

Erica Mitchell

Aries

Front End Developer

Type checking reduces bugs by 15%.

Get Started

> npm install -g typescript

Optional Typing

Transpiling

TypeScript 

JavaScript

const Greeter = (person) => {
    return `Hello ${person}`
}

let user = "Pickle Rick"

document.body.innerHTML = Greeter(user);
var Greeter = function (person) {
    return "Hello " + person;
};
var user = "Pickle Rick";
document.body.innerHTML = Greeter(user);
greeter.ts
greeter.js
const Greeter = (person:string) => {
    return `Hello ${person}`
}

let user = [1,2,3]

document.body.innerHTML = Greeter(user);
error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'string'.

Optional Typing

TypeScript vs....

Made with Slides.com