SlideShare a Scribd company logo
One language to rule them all:
TypeScript
Gil Fink
CEO and senior consultant, sparXys
About Me
• sparXys CEO and senior consultant
• Microsoft MVP in the last 8 years
• Pro Single Page Application Development (Apress) co-author
• 4 Microsoft Official Courses (MOCs) co-author
• GDG Rishon and AngularUP co-organizer
Agenda
• The why
• TypeScript syntax and language features
• Building a simple end-to-end app with TypeScript
• Summary
Wait!
JavaScript?
Are you nuts?
"JavaScript is the assembly
language of the Web"
Erik Meijer
“You can write large
programs in JavaScript. You
just can’t maintain them”
Anders Hejlsberg
Let’s Be Serious
• JavaScript is really a powerful language:
o Functional
o Dynamic
o Can run everywhere
• Huge community
• Big eco-system
• Tools – IDEs, debuggers, test tools and etc.
The Alternatives
• We have several alternatives:
• Hard core vanilla JavaScript development
• JavaScript transpilers
• CoffeeScript – http://coffeescript.org
• Dart – http://dartlang.org
• Clojurescript - https://github.com/clojure/clojurescript
• Script# - http://scriptsharp.com/
What is TypeScript?
“TypeScript is a typed superset of JavaScript that compiles to
plain JavaScript” ~typescriptlang.org
Hello TypeScript
Demo
TypeScript is Very
Flexible
Any Browser Any Host
Any OS Tool Support
Some TypeScript Key
Features
Support
standard
JavaScript
code with
static typing
Encapsulation
through classes
and modules
Support for
constructors,
properties and
functions
Interfaces and
enums
support
Lambda and
generics
support
Intellisense
and syntax
checking
• Modules
• Classes
• Arrow functions
• Default parameters
• Destructuring
• Spread and rest
• Let and const
• for...of
• Object literal
methods
• Shorthand
properties
• Computed
properties
• Octal / binary
literals
• Symbols
• Template strings
• Async/Await
Features from the near Future of
the Web (ES2015/6/7), Today
Choose your
compilation scenario.
It is up to you!
From TypeScript to
JavaScript
class Greeter {
greeting: string;
constructor(message: string) {
this.greeting = message;
}
greet() {
return “Hi," + this.greeting;
}
}
TypeScript Code JavaScript Code
TypeScript
Compiler
var Greeter = (function () {
function Greeter(message) {
this.greeting = message;
}
Greeter.prototype.greet =
function () {
return “Hi," + this.greeting;
};
return Greeter;
})();
tsc.js
How Good is TypeScript’s
Output?
tsconfig.json
• Enables to configure the compiler options:
o Target language (ES3, ES5, ES2015)
o Module system (AMD, ES2015, CommonJS and etc.)
o Source map generation
o Remove comments when compiling
o And more
tsconfig.json
Demo
Some Important Side
Notes
• All JavaScript code is TypeScript code
o Simply copy and paste
• All JavaScript libraries work with TypeScript
o You will need a declaration file to work with the library
@Types
Demo
TypeScript Type
Annotations
• You can add type annotations to variables and
functions
var str: string = ‘hello’; // str is annotated as string
function foo(name: string) : string { // parameter and function annotated
return ‘hello’ + name;
}
TypeScript Types
Type Annotations
Demo
Classes and Interfaces
• You can define classes (same as in ES2015)
• You can define interfaces
o And implement them later
interface IGreeter {
greet(): void;
}
class Greeter implements IGreeter{
greeting: string;
greet() {
console.log(this.greeting);
}
}
var Greeter = (function () {
function Greeter() {
}
Greeter.prototype.greet = function () {
console.log(this.greeting);
};
return Greeter;
})();
Modules
• Uses ES2015 modules syntax
export interface IGreeter {
greet(): void;
}
export class Greeter implements
IGreeter {
greeting: string;
greet() {
console.log(this.greeting);
}
}
var Greeter = (function () {
function Greeter() {
}
Greeter.prototype.greet = function ()
{
console.log(this.greeting);
};
return Greeter;
}());
exports.Greeter = Greeter;
Classes, Modules and
Interfaces
Demo
Building a Simple
End-to-End App with
TypeScript
Demo
TypeScript Versions
• TypeScript 1.0
• TypeScript 2.0
• Current version: TypeScript 2.3.2
What’s New in TypeScript
2?
• Generators and Iteration for ES5/ES3
• Type-checking for JavaScript files
• Null- and undefined-aware types
• ES2017 Spread and Rest
• Improved any inference
• Tagged union types
• And a lot more
Summary
• Open source language that compiles into
JavaScript
• Key features:
• Code encapsulation
• Maintainable code
• Tooling support
• Learn TypeScript today!
Resources
• TypeScript – http://www.typescriptlang.org
• TypeScript Source Code -
https://github.com/Microsoft/TypeScript
• My Website – http://www.gilfink.net
• Follow me on Twitter – @gilfink
Thank You!
Questions?

More Related Content

What's hot (20)

PPTX
Typescript Fundamentals
Sunny Sharma
 
PPTX
Typescript language
.NET Crowd
 
PDF
TypeScript: Angular's Secret Weapon
Laurent Duveau
 
PDF
TypeScript - An Introduction
NexThoughts Technologies
 
PPTX
TypeScript Overview
Aniruddha Chakrabarti
 
PPTX
Introducing type script
Remo Jansen
 
PPTX
Why do we need TypeScript?
Nitay Neeman
 
PDF
Introduction to Angular for .NET Developers
Laurent Duveau
 
PDF
Introduction to Angular for .NET Developers
Laurent Duveau
 
PPTX
Typescript in 30mins
Udaya Kumar
 
PDF
TypeScript 101 - Studio Session - Accenture Liquid Studio
Frances Coronel
 
PPTX
Introduction about type script
Binh Quan Duc
 
PDF
TypeScript: coding JavaScript without the pain
Sander Mak (@Sander_Mak)
 
PDF
TypeScript and Angular workshop
José Manuel García García
 
PDF
Typescript - MentorMate Academy
Dimitar Danailov
 
PDF
Typescript for the programmers who like javascript
Andrei Sebastian Cîmpean
 
PDF
Introduction to TypeScript by Winston Levi
Winston Levi
 
PDF
HelsinkiJS - Clojurescript for Javascript Developers
Juho Teperi
 
PDF
An introduction to go programming language
Technology Parser
 
Typescript Fundamentals
Sunny Sharma
 
Typescript language
.NET Crowd
 
TypeScript: Angular's Secret Weapon
Laurent Duveau
 
TypeScript - An Introduction
NexThoughts Technologies
 
TypeScript Overview
Aniruddha Chakrabarti
 
Introducing type script
Remo Jansen
 
Why do we need TypeScript?
Nitay Neeman
 
Introduction to Angular for .NET Developers
Laurent Duveau
 
Introduction to Angular for .NET Developers
Laurent Duveau
 
Typescript in 30mins
Udaya Kumar
 
TypeScript 101 - Studio Session - Accenture Liquid Studio
Frances Coronel
 
Introduction about type script
Binh Quan Duc
 
TypeScript: coding JavaScript without the pain
Sander Mak (@Sander_Mak)
 
TypeScript and Angular workshop
José Manuel García García
 
Typescript - MentorMate Academy
Dimitar Danailov
 
Typescript for the programmers who like javascript
Andrei Sebastian Cîmpean
 
Introduction to TypeScript by Winston Levi
Winston Levi
 
HelsinkiJS - Clojurescript for Javascript Developers
Juho Teperi
 
An introduction to go programming language
Technology Parser
 

Similar to One language to rule them all type script (20)

PDF
Type script
srinivaskapa1
 
PDF
Mini-Training: TypeScript
Betclic Everest Group Tech Team
 
PPTX
Typescript: JS code just got better!
amit bezalel
 
PDF
One language to rule them all type script
Gil Fink
 
PDF
Building End to-End Web Apps Using TypeScript
Gil Fink
 
PPTX
Angular2
Oswald Campesato
 
PPTX
AngularConf2015
Alessandro Giorgetti
 
PPTX
The advantage of developing with TypeScript
Corley S.r.l.
 
PPTX
Type script
Mallikarjuna G D
 
PDF
Introduction to TypeScript
NexThoughts Technologies
 
PPTX
Benefits of Typescript.pptx
AmitGupta440280
 
PDF
Building End-to-End Apps Using Typescript
Gil Fink
 
PPTX
TypeScript-SPS-melb.pptx
accordv12
 
PDF
Crystal internals (part 1)
Crystal Language
 
PDF
Crystal internals (part 1)
Ary Borenszweig
 
PDF
Crystal internals (part 1)
Ary Borenszweig
 
PPTX
Intro to TypeScript, HTML5DevConf Oct 2013
Matt Harrington
 
PPT
lect1-introductiontoprogramminglanguages-130130013038-phpapp02.ppt
abigailjudith8
 
PPTX
Golang - Overview of Go (golang) Language
Aniruddha Chakrabarti
 
PDF
A Brief History of Programming Languages.pdf
EdFeranil
 
Type script
srinivaskapa1
 
Mini-Training: TypeScript
Betclic Everest Group Tech Team
 
Typescript: JS code just got better!
amit bezalel
 
One language to rule them all type script
Gil Fink
 
Building End to-End Web Apps Using TypeScript
Gil Fink
 
AngularConf2015
Alessandro Giorgetti
 
The advantage of developing with TypeScript
Corley S.r.l.
 
Type script
Mallikarjuna G D
 
Introduction to TypeScript
NexThoughts Technologies
 
Benefits of Typescript.pptx
AmitGupta440280
 
Building End-to-End Apps Using Typescript
Gil Fink
 
TypeScript-SPS-melb.pptx
accordv12
 
Crystal internals (part 1)
Crystal Language
 
Crystal internals (part 1)
Ary Borenszweig
 
Crystal internals (part 1)
Ary Borenszweig
 
Intro to TypeScript, HTML5DevConf Oct 2013
Matt Harrington
 
lect1-introductiontoprogramminglanguages-130130013038-phpapp02.ppt
abigailjudith8
 
Golang - Overview of Go (golang) Language
Aniruddha Chakrabarti
 
A Brief History of Programming Languages.pdf
EdFeranil
 
Ad

More from Gil Fink (20)

PDF
Becoming a Tech Speaker
Gil Fink
 
PPTX
Web animation on steroids web animation api
Gil Fink
 
PDF
The Time for Vanilla Web Components has Arrived
Gil Fink
 
PDF
Stencil the time for vanilla web components has arrived
Gil Fink
 
PDF
Stencil the time for vanilla web components has arrived
Gil Fink
 
PDF
Stencil: The Time for Vanilla Web Components has Arrived
Gil Fink
 
PDF
Stencil the time for vanilla web components has arrived
Gil Fink
 
PDF
Being a tech speaker
Gil Fink
 
PDF
Working with Data in Service Workers
Gil Fink
 
PDF
Demystifying Angular Animations
Gil Fink
 
PDF
Redux data flow with angular
Gil Fink
 
PDF
Redux data flow with angular
Gil Fink
 
PDF
Who's afraid of front end databases?
Gil Fink
 
PDF
Web component driven development
Gil Fink
 
PDF
Web components
Gil Fink
 
PDF
Redux data flow with angular 2
Gil Fink
 
PDF
Biological Modeling, Powered by AngularJS
Gil Fink
 
PDF
Who's afraid of front end databases
Gil Fink
 
PDF
Biological modeling, powered by angular js
Gil Fink
 
PDF
Web components the future is here
Gil Fink
 
Becoming a Tech Speaker
Gil Fink
 
Web animation on steroids web animation api
Gil Fink
 
The Time for Vanilla Web Components has Arrived
Gil Fink
 
Stencil the time for vanilla web components has arrived
Gil Fink
 
Stencil the time for vanilla web components has arrived
Gil Fink
 
Stencil: The Time for Vanilla Web Components has Arrived
Gil Fink
 
Stencil the time for vanilla web components has arrived
Gil Fink
 
Being a tech speaker
Gil Fink
 
Working with Data in Service Workers
Gil Fink
 
Demystifying Angular Animations
Gil Fink
 
Redux data flow with angular
Gil Fink
 
Redux data flow with angular
Gil Fink
 
Who's afraid of front end databases?
Gil Fink
 
Web component driven development
Gil Fink
 
Web components
Gil Fink
 
Redux data flow with angular 2
Gil Fink
 
Biological Modeling, Powered by AngularJS
Gil Fink
 
Who's afraid of front end databases
Gil Fink
 
Biological modeling, powered by angular js
Gil Fink
 
Web components the future is here
Gil Fink
 
Ad

Recently uploaded (20)

PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Python basic programing language for automation
DanialHabibi2
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
July Patch Tuesday
Ivanti
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 

One language to rule them all type script

  • 1. One language to rule them all: TypeScript Gil Fink CEO and senior consultant, sparXys
  • 2. About Me • sparXys CEO and senior consultant • Microsoft MVP in the last 8 years • Pro Single Page Application Development (Apress) co-author • 4 Microsoft Official Courses (MOCs) co-author • GDG Rishon and AngularUP co-organizer
  • 3. Agenda • The why • TypeScript syntax and language features • Building a simple end-to-end app with TypeScript • Summary
  • 5. "JavaScript is the assembly language of the Web" Erik Meijer
  • 6. “You can write large programs in JavaScript. You just can’t maintain them” Anders Hejlsberg
  • 7. Let’s Be Serious • JavaScript is really a powerful language: o Functional o Dynamic o Can run everywhere • Huge community • Big eco-system • Tools – IDEs, debuggers, test tools and etc.
  • 8. The Alternatives • We have several alternatives: • Hard core vanilla JavaScript development • JavaScript transpilers • CoffeeScript – http://coffeescript.org • Dart – http://dartlang.org • Clojurescript - https://github.com/clojure/clojurescript • Script# - http://scriptsharp.com/
  • 9. What is TypeScript? “TypeScript is a typed superset of JavaScript that compiles to plain JavaScript” ~typescriptlang.org
  • 11. TypeScript is Very Flexible Any Browser Any Host Any OS Tool Support
  • 12. Some TypeScript Key Features Support standard JavaScript code with static typing Encapsulation through classes and modules Support for constructors, properties and functions Interfaces and enums support Lambda and generics support Intellisense and syntax checking
  • 13. • Modules • Classes • Arrow functions • Default parameters • Destructuring • Spread and rest • Let and const • for...of • Object literal methods • Shorthand properties • Computed properties • Octal / binary literals • Symbols • Template strings • Async/Await Features from the near Future of the Web (ES2015/6/7), Today Choose your compilation scenario. It is up to you!
  • 14. From TypeScript to JavaScript class Greeter { greeting: string; constructor(message: string) { this.greeting = message; } greet() { return “Hi," + this.greeting; } } TypeScript Code JavaScript Code TypeScript Compiler var Greeter = (function () { function Greeter(message) { this.greeting = message; } Greeter.prototype.greet = function () { return “Hi," + this.greeting; }; return Greeter; })(); tsc.js
  • 15. How Good is TypeScript’s Output?
  • 16. tsconfig.json • Enables to configure the compiler options: o Target language (ES3, ES5, ES2015) o Module system (AMD, ES2015, CommonJS and etc.) o Source map generation o Remove comments when compiling o And more
  • 18. Some Important Side Notes • All JavaScript code is TypeScript code o Simply copy and paste • All JavaScript libraries work with TypeScript o You will need a declaration file to work with the library
  • 20. TypeScript Type Annotations • You can add type annotations to variables and functions var str: string = ‘hello’; // str is annotated as string function foo(name: string) : string { // parameter and function annotated return ‘hello’ + name; }
  • 23. Classes and Interfaces • You can define classes (same as in ES2015) • You can define interfaces o And implement them later interface IGreeter { greet(): void; } class Greeter implements IGreeter{ greeting: string; greet() { console.log(this.greeting); } } var Greeter = (function () { function Greeter() { } Greeter.prototype.greet = function () { console.log(this.greeting); }; return Greeter; })();
  • 24. Modules • Uses ES2015 modules syntax export interface IGreeter { greet(): void; } export class Greeter implements IGreeter { greeting: string; greet() { console.log(this.greeting); } } var Greeter = (function () { function Greeter() { } Greeter.prototype.greet = function () { console.log(this.greeting); }; return Greeter; }()); exports.Greeter = Greeter;
  • 26. Building a Simple End-to-End App with TypeScript Demo
  • 27. TypeScript Versions • TypeScript 1.0 • TypeScript 2.0 • Current version: TypeScript 2.3.2
  • 28. What’s New in TypeScript 2? • Generators and Iteration for ES5/ES3 • Type-checking for JavaScript files • Null- and undefined-aware types • ES2017 Spread and Rest • Improved any inference • Tagged union types • And a lot more
  • 29. Summary • Open source language that compiles into JavaScript • Key features: • Code encapsulation • Maintainable code • Tooling support • Learn TypeScript today!
  • 30. Resources • TypeScript – http://www.typescriptlang.org • TypeScript Source Code - https://github.com/Microsoft/TypeScript • My Website – http://www.gilfink.net • Follow me on Twitter – @gilfink