SlideShare a Scribd company logo
3
Most read
14
Most read
15
Most read
Typescript
• What's Typescript?
• Type Annotation
• Functions
• Class
• Inheritance
• Module
• Interface
• Generics
• Declaration source files (*.d.ts)
• New features
Agenda
• JavaScript is not originally designed for large complex applications (mostly a scripting language, with
functional programming constructs), lacks structuring mechanisms like Class, Module, Interface.
• Typescript is a typed superset of JavaScript that compiles to plain JavaScript.
• Adds additional features like Static Type (optional), Class, Module etc. to JavaScript
• Microsoft technology.
• Open Source.
• Versions.
• First made public in October 2012.
• Latest version - Typescript 1.7.
What’s Typescript?
• Any
• Any Type is a super set of all types
• var x : any;
• var y;
• Primitive
• Number
• Does not have separate integer and float/double type.
• var num : number = 20;
• var num = 20;
• String
• Both single quote or double quotes can be used.
• var name : string = “hello”;
• var name =’hello’;
• Bool
• var isOpen =true;
Type Annotation
• Void
• Used as the return type of functions that don’t return any value
• Object Types
• class, interface, module.
• Array
• Array types can be written in:
• var list: number[] = [1, 2, 3];
• var list: Array<number> = [1, 2, 3];
• var list:any[] = [1, true, "free"]
• Enum
• enum Color { Red, Green, Blue };
• var color = Color.Blue;
Type Annotation
• Tuple
• Tuple types allow you to express an array where the type of a fixed number of elements is known.
• var x: [string, number];
x = ['hello', 10];
Type Annotation
• Design time feature. No additional code is emitted in the final JavaScript that TypeScript compiler
produces.
• If there’s a type mismatch TypeScript shows a warning.
Type Annotation
• Type Annotation for parameter and return type.
• Optional and Default Parameter.
• Function Overloads.
• Fat Arrow functions.
• Rest parameters.
• denoted by ‘...argumentName’ for the last argument allow you to quickly accept multiple
arguments in your function and get them as an array.
Functions
• Properties and fields to store data
• Methods to define behavior
Class
• Typescript supports inheritance of class through extends keyword
• super keyword.
Inheritance
• Modules can be defined using module keyword.
• A module can contain sub module, class, interface or enum.
• Class, Interfaces , functions can be exposed using export keyword.
• Adding file references. - /// <reference path=“filename.ts" />
Module
• Declared using interface keyword
• TS compiler shows error when Interface signature and implementation does not match
• Optional properties can be declared for an interface (using ?)
Interface
• Able to create a component that can work over a variety of types rather than a single one.
function identity<T>(arg: T): T {
return arg;
}
• type argument inference - we want the compiler to set the value of T for us automatically based on
the type of the argument we pass in.
Generics
• The purpose of these files is to provide some typing information for JavaScript libraries.
• These files do not compile to .js files, simply describe their JavaScript implementations, and act as their
representative.
• Contains typing info.
• http://definitelytyped.org/
Declaration source files (*.d.ts)
• await & async
• for..of – iteration.
• Exponentiation operators - ** and **=
• Spread operator
New features

More Related Content

PDF
TypeScript
Saray Chak
 
PPT
TypeScript Presentation
Patrick John Pacaña
 
PDF
TypeScript - An Introduction
NexThoughts Technologies
 
PPTX
TypeScript VS JavaScript.pptx
Albiorix Technology
 
PPTX
TypeScript Overview
Aniruddha Chakrabarti
 
PPTX
Typescript Fundamentals
Sunny Sharma
 
PDF
TypeScript: coding JavaScript without the pain
Sander Mak (@Sander_Mak)
 
PDF
TypeScript Introduction
Dmitry Sheiko
 
TypeScript
Saray Chak
 
TypeScript Presentation
Patrick John Pacaña
 
TypeScript - An Introduction
NexThoughts Technologies
 
TypeScript VS JavaScript.pptx
Albiorix Technology
 
TypeScript Overview
Aniruddha Chakrabarti
 
Typescript Fundamentals
Sunny Sharma
 
TypeScript: coding JavaScript without the pain
Sander Mak (@Sander_Mak)
 
TypeScript Introduction
Dmitry Sheiko
 

What's hot (20)

PPTX
Typescript in 30mins
Udaya Kumar
 
PPTX
Introducing type script
Remo Jansen
 
PPT
Angular 8
Sunil OS
 
PPTX
Getting started with typescript
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
PPTX
TypeScript
Udaiappa Ramachandran
 
PDF
TypeScript Best Practices
felixbillon
 
PPTX
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Malla Reddy University
 
ODP
An Introduction To Jenkins
Knoldus Inc.
 
PPTX
.Net Core
Bertrand Le Roy
 
PPTX
Why TypeScript?
FITC
 
PDF
The New JavaScript: ES6
Rob Eisenberg
 
PDF
Nestjs MasterClass Slides
Nir Kaufman
 
PDF
Gradle Introduction
Dmitry Buzdin
 
PPTX
Core java complete ppt(note)
arvind pandey
 
PDF
Collections In Java
Binoj T E
 
PDF
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
PPTX
Introduction to angular with a simple but complete project
Jadson Santos
 
PPTX
Introduction to java 8 stream api
Vladislav sidlyarevich
 
PPTX
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
PDF
Nodejs presentation
Arvind Devaraj
 
Typescript in 30mins
Udaya Kumar
 
Introducing type script
Remo Jansen
 
Angular 8
Sunil OS
 
Getting started with typescript
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
TypeScript Best Practices
felixbillon
 
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Malla Reddy University
 
An Introduction To Jenkins
Knoldus Inc.
 
.Net Core
Bertrand Le Roy
 
Why TypeScript?
FITC
 
The New JavaScript: ES6
Rob Eisenberg
 
Nestjs MasterClass Slides
Nir Kaufman
 
Gradle Introduction
Dmitry Buzdin
 
Core java complete ppt(note)
arvind pandey
 
Collections In Java
Binoj T E
 
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
Introduction to angular with a simple but complete project
Jadson Santos
 
Introduction to java 8 stream api
Vladislav sidlyarevich
 
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
Nodejs presentation
Arvind Devaraj
 
Ad

Viewers also liked (16)

PDF
TypeScript Seminar
Haim Michael
 
PDF
Angular 2 - Typescript
Nathan Krasney
 
PPTX
TypeScript
GetDev.NET
 
PDF
TypeScript: Un lenguaje aburrido para programadores torpes y tristes
Micael Gallego
 
PDF
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
Ontico
 
PDF
Power Leveling your TypeScript
Offirmo
 
PPTX
Typescript tips & tricks
Ori Calvo
 
PDF
TypeScript for Java Developers
Yakov Fain
 
PDF
Александр Русаков - TypeScript 2 in action
MoscowJS
 
PPTX
Typescript
Nikhil Thomas
 
PPTX
002. Introducere in type script
Dmitrii Stoian
 
PDF
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
MoscowJS
 
PPTX
TypeScript - Silver Bullet for the Full-stack Developers
Rutenis Turcinas
 
PDF
TypeScript: Angular's Secret Weapon
Laurent Duveau
 
PDF
Typescript + Graphql = <3
felixbillon
 
PDF
TypeScriptで快適javascript
AfiruPain NaokiSoga
 
TypeScript Seminar
Haim Michael
 
Angular 2 - Typescript
Nathan Krasney
 
TypeScript
GetDev.NET
 
TypeScript: Un lenguaje aburrido para programadores torpes y tristes
Micael Gallego
 
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
Ontico
 
Power Leveling your TypeScript
Offirmo
 
Typescript tips & tricks
Ori Calvo
 
TypeScript for Java Developers
Yakov Fain
 
Александр Русаков - TypeScript 2 in action
MoscowJS
 
Typescript
Nikhil Thomas
 
002. Introducere in type script
Dmitrii Stoian
 
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
MoscowJS
 
TypeScript - Silver Bullet for the Full-stack Developers
Rutenis Turcinas
 
TypeScript: Angular's Secret Weapon
Laurent Duveau
 
Typescript + Graphql = <3
felixbillon
 
TypeScriptで快適javascript
AfiruPain NaokiSoga
 
Ad

Similar to Typescript ppt (20)

PPTX
TypeScript: Basic Features and Compilation Guide
Nascenia IT
 
PPTX
TypeScript 101
rachelterman
 
PPTX
Complete Notes on Angular 2 and TypeScript
EPAM Systems
 
PPTX
typescript.pptx
ZeynepOtu
 
PDF
TypeScript introduction to scalable javascript application
Andrea Paciolla
 
PDF
TypeScript Interview Questions PDF By ScholarHat
Scholarhat
 
PPTX
Rits Brown Bag - TypeScript
Right IT Services
 
PDF
TYPESCRIPT.pdfgshshhsjajajsjsjjsjajajjajjj
sonidsxyz02
 
PDF
TypeScipt - Get Started
Krishnanand Sivaraj
 
PDF
Reasons to Use Typescript for Your Next Project Over Javascript.pdf
MobMaxime
 
PPTX
TypeScript intro
Ats Uiboupin
 
PDF
Back to the Future with TypeScript
Aleš Najmann
 
PPT
TypeScript.ppt LPU Notes Lecture PPT for 2024
manveersingh2k05
 
PPTX
Type script
Zunair Shoes
 
PDF
Introduction to TypeScript
NexThoughts Technologies
 
PPTX
Typescript: Beginner to Advanced
Talentica Software
 
PPTX
Why do we need TypeScript?
Nitay Neeman
 
ODP
Getting started with typescript and angular 2
Knoldus Inc.
 
PPTX
Typescript language extension of java script
michaelaaron25322
 
PPTX
All You Need to Know About Type Script
Folio3 Software
 
TypeScript: Basic Features and Compilation Guide
Nascenia IT
 
TypeScript 101
rachelterman
 
Complete Notes on Angular 2 and TypeScript
EPAM Systems
 
typescript.pptx
ZeynepOtu
 
TypeScript introduction to scalable javascript application
Andrea Paciolla
 
TypeScript Interview Questions PDF By ScholarHat
Scholarhat
 
Rits Brown Bag - TypeScript
Right IT Services
 
TYPESCRIPT.pdfgshshhsjajajsjsjjsjajajjajjj
sonidsxyz02
 
TypeScipt - Get Started
Krishnanand Sivaraj
 
Reasons to Use Typescript for Your Next Project Over Javascript.pdf
MobMaxime
 
TypeScript intro
Ats Uiboupin
 
Back to the Future with TypeScript
Aleš Najmann
 
TypeScript.ppt LPU Notes Lecture PPT for 2024
manveersingh2k05
 
Type script
Zunair Shoes
 
Introduction to TypeScript
NexThoughts Technologies
 
Typescript: Beginner to Advanced
Talentica Software
 
Why do we need TypeScript?
Nitay Neeman
 
Getting started with typescript and angular 2
Knoldus Inc.
 
Typescript language extension of java script
michaelaaron25322
 
All You Need to Know About Type Script
Folio3 Software
 

Recently uploaded (20)

PPTX
TestNG for Java Testing and Automation testing
ssuser0213cb
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PDF
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pdf
Certivo Inc
 
PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PDF
Become an Agentblazer Champion Challenge
Dele Amefo
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PDF
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
PDF
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
PDF
Solar Panel Installation Guide – Step By Step Process 2025.pdf
CRMLeaf
 
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
PDF
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
NSIQINFOTECH
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PPTX
Presentation of Computer CLASS 2 .pptx
darshilchaudhary558
 
TestNG for Java Testing and Automation testing
ssuser0213cb
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pdf
Certivo Inc
 
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
Become an Agentblazer Champion Challenge
Dele Amefo
 
Activate_Methodology_Summary presentatio
annapureddyn
 
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
Solar Panel Installation Guide – Step By Step Process 2025.pdf
CRMLeaf
 
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
NSIQINFOTECH
 
Presentation about variables and constant.pptx
safalsingh810
 
Presentation of Computer CLASS 2 .pptx
darshilchaudhary558
 

Typescript ppt

  • 2. • What's Typescript? • Type Annotation • Functions • Class • Inheritance • Module • Interface • Generics • Declaration source files (*.d.ts) • New features Agenda
  • 3. • JavaScript is not originally designed for large complex applications (mostly a scripting language, with functional programming constructs), lacks structuring mechanisms like Class, Module, Interface. • Typescript is a typed superset of JavaScript that compiles to plain JavaScript. • Adds additional features like Static Type (optional), Class, Module etc. to JavaScript • Microsoft technology. • Open Source. • Versions. • First made public in October 2012. • Latest version - Typescript 1.7. What’s Typescript?
  • 4. • Any • Any Type is a super set of all types • var x : any; • var y; • Primitive • Number • Does not have separate integer and float/double type. • var num : number = 20; • var num = 20; • String • Both single quote or double quotes can be used. • var name : string = “hello”; • var name =’hello’; • Bool • var isOpen =true; Type Annotation
  • 5. • Void • Used as the return type of functions that don’t return any value • Object Types • class, interface, module. • Array • Array types can be written in: • var list: number[] = [1, 2, 3]; • var list: Array<number> = [1, 2, 3]; • var list:any[] = [1, true, "free"] • Enum • enum Color { Red, Green, Blue }; • var color = Color.Blue; Type Annotation
  • 6. • Tuple • Tuple types allow you to express an array where the type of a fixed number of elements is known. • var x: [string, number]; x = ['hello', 10]; Type Annotation
  • 7. • Design time feature. No additional code is emitted in the final JavaScript that TypeScript compiler produces. • If there’s a type mismatch TypeScript shows a warning. Type Annotation
  • 8. • Type Annotation for parameter and return type. • Optional and Default Parameter. • Function Overloads. • Fat Arrow functions. • Rest parameters. • denoted by ‘...argumentName’ for the last argument allow you to quickly accept multiple arguments in your function and get them as an array. Functions
  • 9. • Properties and fields to store data • Methods to define behavior Class
  • 10. • Typescript supports inheritance of class through extends keyword • super keyword. Inheritance
  • 11. • Modules can be defined using module keyword. • A module can contain sub module, class, interface or enum. • Class, Interfaces , functions can be exposed using export keyword. • Adding file references. - /// <reference path=“filename.ts" /> Module
  • 12. • Declared using interface keyword • TS compiler shows error when Interface signature and implementation does not match • Optional properties can be declared for an interface (using ?) Interface
  • 13. • Able to create a component that can work over a variety of types rather than a single one. function identity<T>(arg: T): T { return arg; } • type argument inference - we want the compiler to set the value of T for us automatically based on the type of the argument we pass in. Generics
  • 14. • The purpose of these files is to provide some typing information for JavaScript libraries. • These files do not compile to .js files, simply describe their JavaScript implementations, and act as their representative. • Contains typing info. • http://definitelytyped.org/ Declaration source files (*.d.ts)
  • 15. • await & async • for..of – iteration. • Exponentiation operators - ** and **= • Spread operator New features

Editor's Notes

  • #4: TypeScript compiler, named tsc, iswritten in TypeScript that can be compiled into regular JavaScript that can be executed in any JavaScript engine in any host. Typescript 0.9, released in 2013, added support for generics Typescript 1.0 was released at Build 2014
  • #5: All numbers in Typescript are floating point values. These floating point numbers get the type 'number'.
  • #7: automatic semicolon insertion
  • #9: -we can also pass functions in functions as arguments