http://rockalabs.com/ 

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

What's TypeScript?

Extend modern javascript language, that help you scale your app.

LET'S BUILD TOGETHER

languages and type safety

Tools that give

LET'S BUILD TOGETHER

  • If find any bug notify you
  • Analyze the code and this one generate Javascript

 

  • The Same project with TS and JS

 

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

Basic Types
  • number 
  • string
  • boolean
  • any

Is a way very generic for define the variables

most strict

LET'S BUILD TOGETHER

Use Cases
  • Value with the same type of variable
  • Return Typed in Functions
  • Call a Function
  • Optional Parameters 

LET'S BUILD TOGETHER

Other Types
  • Union 
  • Enum
  • Types in Funcionts
  • Objects

are  definitions

of concepts

LET'S BUILD TOGETHER

There are classes in TtypeScript !

Of course

LET'S BUILD TOGETHER

class User {

    constructor (name,age){
        this.name = name;
        this.age = age;
    }

    getName(){
        return this.name;
    }

    getAge(){
        return this.age;
    }

}


let user1  =  new User("John",22);
let user2  =  new User("Pedro",24);

Classes in ES6

LET'S BUILD TOGETHER


class User {

    private name : string;
    private age  : number;

    constructor (name:string,age:number){
        this.name = name;
        this.age = age;
    }

    getName(){
        return this.name;
    }

    getAge(){
        return this.age;
    }

}


let user1  =  new User("John",22);
let user2  =  new User("Pedro",24);

Classes in TS

LET'S BUILD TOGETHER

http://rockalabs.com

jdmorales092@gmail.com

John Darwin Morales

Frontend Developer

ROCKALABS

Introduction to TypeScript

By John Darwin Morales González

Introduction to TypeScript

  • 1,214