SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Anubhav Tarar
Trainee Software
Consultant
anubhav.tarar@knoldus.in
Getting Started
With
Typescript
Agenda
1. What is TypeScript
2. Benefits
3. Typescript Vs. JavaScript
4. New features of Typescript
5. Installation
6. How to compile Typescript file
7. How to compile multiple Typescript file into a single js file
8. Enable the Typescript Compiler
9. Demo
What is TypeScript ?
• Type Script is a superset of JavaScript
• Type Script is a free and open source programming language
developed and maintained by Microsoft.
• Type Script files are compiled to readable JavaScript
Benefits
• Big advantage of Typescript is we identify Type related issues
early before going to production
• You can even set the JS version that you want your resulting
code on.
• Typescript allows us to define new classes and new
• Typescript is statically typed
TypeScript Vs. JavaScript
• JavaScript has ambiguity because of having no datatype
declaration which is now possible in Type Script. It makes the
code more understandable and easy
• It allows us to use javascript as if an object oriented code which
is much more clear than javascript due to its syntax.
• Typescript include function overloading but javascript does not
• TypeScript is optionally typed by default
• For a large JavaScript project, adopting TypeScript might result
in more robust software, while still being deployable where a
regular JavaScript application would run.
Features Of TypeScript
TYPES
Type Annotation
• The type annotation we can add to a variable we define, should
come after the variable identified and should be preceded by a
colon.
• var id:number = 123123;
• var name:string = "mosh";
• var tall:boolean = true;
Dynamic Type
• TypeScript is optionally statically typed programming language.
The types are checked in order to preventassignment of invalid
values in term of their types.
• We can optionally change the variable into a dynamic one.
var demo:any =5;
demo =''john”;
demo = new Object();
Automatic Type Inferring
• When assigning a variable, that was just created, with a value,
the TypeScript execution environment automatically identifies
the type and from that moment on the type of that variable is
unchanged.
• var demo = 1;
• demo ='abc' // result in compilation error
Type Eraser
When compiling the TypeScript code into JavaScript all of the
type annotations are removed.
App.ts
var a: number = 3;
var b: string = 'abc';
App.js after Compilation
var a = 3;
var b = 'abc';
Constructor
• When we define a new class it automatically has a constructor.
The default one. We can define a new constructor. When doing
so, the default one will be deleted.
• When we define a new constructor we can specify each one of
its parameters with an access modifier and by doing so
indirectly define those parameters as instance variables
Constructor
class Person {
constructor(public name:String)
{ this.name = name;}
greet():String={ return “my name is”+this.name);
}
}
var person = new Person(“john);
Console.log(person.greet);
Interfaces(ts file)
interface LabelledValue { label: string;}
function printLabel(labelledObj: LabelledValue)
{ console.log(labelledObj.label) }
let myObj = {size: 10, label: "Size 10 Object"};
printLabel(myObj);
The interface LabelledValue is a name we can now use to
describe the requirement in the previous example.
• It still represents having a single property called label that is of
type string.
• Notice we didn’t have to explicitly say that the object we pass
to printLabel implements this interface like we might have to in
other languages. Here, it’s only the shape that matters. If the
object we pass to the function meets the requirements listed,
then it’s allowed.
Function Overloading(.ts file)
class Customer {
name: string;
Id: number;
add(Id: number);
add(name:string);
add(value: any) {
if (value && typeof value == "number")
{ //Do something }
if (value && typeof value == "string")
{ //Do Something }
}
}
Function Overloading(.js file)
var Customer = (function () {
function Customer() {
}
Customer.prototype.add = function (value) {
if (value && typeof value == "number") {
}
if (value && typeof value == "string") {
}
};
return Customer;
}());
TypeScript Support Optional Properties
In JavaScript, every parameter is considered optional. If no value is supplied,
then it is treated as undefined. So while writing in TypeScript, we can make
a parameter optional using the “?” after the parameter name.
interface SquareConfig { color?: string;width?: number;}
function createSquare(config: SquareConfig): {color: string; area: number}
{ let newSquare = {color: "white", area: 100};
if (config.color) { newSquare.color = config.color; }
if (config.width) { newSquare.area = config.width * config.width; }
return newSquare; }
let mySquare = createSquare({color: "black"});
How Do You Compile TypeScript Files?
The extension for any TypeScript file is “.ts”. And any JavaScript
file is TypeScript file as it is a superset of JavaScript. So change
extension of “.js” to “.ts” file and your TypeScript file is ready. To
compile any .ts file into .js, use the following command.
tsc <TypeScript File Name>
For example, to compile “Helloworld.ts”:
• tsc helloworld.ts
• And the result would be helloworld.js.
Is It Possible to Combine Multiple .ts Files
into a Single .js File?
Yes, it's possible. While compiling add --outFILE
[OutputJSFileName] option.
• tsc --outFile comman.js file1.ts file2.ts file3.ts
• This will compile all 3 “.ts” file and output into single
“comman.js” file. And what will happen if you don’t provide a
output file name.
• tsc --outFile file1.ts file2.ts file3.ts
• In this case, file2.ts and file3.ts will be compiled and the output
will be placed in file1.ts. So now your file1.ts contains
JavaScript code.
How to install Typescript
1.Install git
2.Install nodejs
3.Install Typescript
npm install -g typescript
Working Example(func.ts)
class customer{
name:String;
constructor(name:String){
this.name= name;
}
}
Working Example(func1.ts)
class cust {
name:string;
Id:number;
add(Id:number);
add(name:string);
add(value:any){
}
}
tsc --outFile comman.js func1.ts func.ts
Working Example(comman.js)
var customer = (function () {
function customer(name) { this.name = name; }
return customer;
}());
var cust = (function () {
function cust() { }
cust.prototype.add = function (value) { };
return cust;
}());
Enabling the TypeScript Compiler
In order to develop code in TypeScript using the
PHPStorm or the WebStorm IDE we should perform following steps
• In the Default Preferences setting window, enable the
• TypeSciprt compiler, specifying the node interpreter and
• specify the main file we want to compile.
Designing a Demo.ts File
class Demo{
name:String;
constructor(name:String) {
this.name = name;}
display():String{
return "my name is"+name;
}
}
var demo = new Demo("anubhav");
console.log(demo.display());
Automatically Generated Demo.js File
var Demo = (function ()
{
function Demo(name) {
this.name = name;
}
Demo.prototype.display = function () {
return "my name is" + name;
};
return Demo;
}());
var demo = new Demo("anubhav");
console.log(demo.display())
Working demo
Angular 2 With TypeScript
you can clone it from repo
https://github.com/anubhav100/angular2.git
.
References
https://www.typescriptlang.org/docs/tutorial.html
http://stackoverflow.com/questions/12694530/what-is-typescri
https://www.youtube.com/watch?v=KGdxz9C6QLA
Thanks

Weitere ähnliche Inhalte

Was ist angesagt?

002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type scriptDmitrii Stoian
 
Typescript for the programmers who like javascript
Typescript for the programmers who like javascriptTypescript for the programmers who like javascript
Typescript for the programmers who like javascriptAndrei Sebastian Cîmpean
 
Shapeless- Generic programming for Scala
Shapeless- Generic programming for ScalaShapeless- Generic programming for Scala
Shapeless- Generic programming for ScalaKnoldus Inc.
 
TypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideTypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideNascenia IT
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScriptOffirmo
 
TypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponTypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponLaurent Duveau
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java DevelopersYakov Fain
 
Typescript: enjoying large scale browser development
Typescript: enjoying large scale browser developmentTypescript: enjoying large scale browser development
Typescript: enjoying large scale browser developmentJoost de Vries
 

Was ist angesagt? (20)

Getting started with typescript
Getting started with typescriptGetting started with typescript
Getting started with typescript
 
002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type script
 
TypeScript
TypeScriptTypeScript
TypeScript
 
TypeScript intro
TypeScript introTypeScript intro
TypeScript intro
 
Typescript for the programmers who like javascript
Typescript for the programmers who like javascriptTypescript for the programmers who like javascript
Typescript for the programmers who like javascript
 
Learning typescript
Learning typescriptLearning typescript
Learning typescript
 
Shapeless- Generic programming for Scala
Shapeless- Generic programming for ScalaShapeless- Generic programming for Scala
Shapeless- Generic programming for Scala
 
Typescript ppt
Typescript pptTypescript ppt
Typescript ppt
 
TypeScript
TypeScriptTypeScript
TypeScript
 
Typescript Basics
Typescript BasicsTypescript Basics
Typescript Basics
 
TypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideTypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation Guide
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScript
 
Introducing TypeScript
Introducing TypeScriptIntroducing TypeScript
Introducing TypeScript
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
 
TypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponTypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret Weapon
 
AngularConf2015
AngularConf2015AngularConf2015
AngularConf2015
 
TypeScript Presentation
TypeScript PresentationTypeScript Presentation
TypeScript Presentation
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java Developers
 
Typescript: enjoying large scale browser development
Typescript: enjoying large scale browser developmentTypescript: enjoying large scale browser development
Typescript: enjoying large scale browser development
 

Andere mochten auch

Introduction to Knockout Js
Introduction to Knockout JsIntroduction to Knockout Js
Introduction to Knockout JsKnoldus Inc.
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsKnoldus Inc.
 
Functional programming in Javascript
Functional programming in JavascriptFunctional programming in Javascript
Functional programming in JavascriptKnoldus Inc.
 
Introduction to Apache Cassandra
Introduction to Apache Cassandra Introduction to Apache Cassandra
Introduction to Apache Cassandra Knoldus Inc.
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDDKnoldus Inc.
 
How You Convince Your Manager To Adopt Scala.js in Production
How You Convince Your Manager To Adopt Scala.js in ProductionHow You Convince Your Manager To Adopt Scala.js in Production
How You Convince Your Manager To Adopt Scala.js in ProductionBoldRadius Solutions
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sassKnoldus Inc.
 
Akka Finite State Machine
Akka Finite State MachineAkka Finite State Machine
Akka Finite State MachineKnoldus Inc.
 
Scala.js for large and complex frontend apps
Scala.js for large and complex frontend appsScala.js for large and complex frontend apps
Scala.js for large and complex frontend appsOtto Chrons
 
TypeScript - das bessere JavaScript!?
TypeScript - das bessere JavaScript!?TypeScript - das bessere JavaScript!?
TypeScript - das bessere JavaScript!?Christian Kaltepoth
 
Introduction about type script
Introduction about type scriptIntroduction about type script
Introduction about type scriptBinh Quan Duc
 
Typescript - MentorMate Academy
Typescript - MentorMate AcademyTypescript - MentorMate Academy
Typescript - MentorMate AcademyDimitar Danailov
 
Building End to-End Web Apps Using TypeScript
Building End to-End Web Apps Using TypeScriptBuilding End to-End Web Apps Using TypeScript
Building End to-End Web Apps Using TypeScriptGil Fink
 
Introduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogicIntroduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogicSmartLogic
 
Launch Yourself into The AngularJS 2 And TypeScript Space
Launch Yourself into The AngularJS 2 And TypeScript SpaceLaunch Yourself into The AngularJS 2 And TypeScript Space
Launch Yourself into The AngularJS 2 And TypeScript SpaceColdFusionConference
 
Introduction to Scala JS
Introduction to Scala JSIntroduction to Scala JS
Introduction to Scala JSKnoldus Inc.
 
Getting Started With AureliaJs
Getting Started With AureliaJsGetting Started With AureliaJs
Getting Started With AureliaJsKnoldus Inc.
 

Andere mochten auch (20)

Introduction to Knockout Js
Introduction to Knockout JsIntroduction to Knockout Js
Introduction to Knockout Js
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventions
 
Functional programming in Javascript
Functional programming in JavascriptFunctional programming in Javascript
Functional programming in Javascript
 
Introduction to Apache Cassandra
Introduction to Apache Cassandra Introduction to Apache Cassandra
Introduction to Apache Cassandra
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDD
 
How You Convince Your Manager To Adopt Scala.js in Production
How You Convince Your Manager To Adopt Scala.js in ProductionHow You Convince Your Manager To Adopt Scala.js in Production
How You Convince Your Manager To Adopt Scala.js in Production
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
 
Akka Finite State Machine
Akka Finite State MachineAkka Finite State Machine
Akka Finite State Machine
 
Scala.js for large and complex frontend apps
Scala.js for large and complex frontend appsScala.js for large and complex frontend apps
Scala.js for large and complex frontend apps
 
TypeScript - das bessere JavaScript!?
TypeScript - das bessere JavaScript!?TypeScript - das bessere JavaScript!?
TypeScript - das bessere JavaScript!?
 
Introduction about type script
Introduction about type scriptIntroduction about type script
Introduction about type script
 
Typescript - MentorMate Academy
Typescript - MentorMate AcademyTypescript - MentorMate Academy
Typescript - MentorMate Academy
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
Building End to-End Web Apps Using TypeScript
Building End to-End Web Apps Using TypeScriptBuilding End to-End Web Apps Using TypeScript
Building End to-End Web Apps Using TypeScript
 
Introduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogicIntroduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogic
 
Type script
Type scriptType script
Type script
 
Launch Yourself into The AngularJS 2 And TypeScript Space
Launch Yourself into The AngularJS 2 And TypeScript SpaceLaunch Yourself into The AngularJS 2 And TypeScript Space
Launch Yourself into The AngularJS 2 And TypeScript Space
 
TypeScript 2 in action
TypeScript 2 in actionTypeScript 2 in action
TypeScript 2 in action
 
Introduction to Scala JS
Introduction to Scala JSIntroduction to Scala JS
Introduction to Scala JS
 
Getting Started With AureliaJs
Getting Started With AureliaJsGetting Started With AureliaJs
Getting Started With AureliaJs
 

Ähnlich wie Getting started with typescript and angular 2

An Introduction to TypeScript
An Introduction to TypeScriptAn Introduction to TypeScript
An Introduction to TypeScriptWrapPixel
 
Typescript language extension of java script
Typescript language extension of java scriptTypescript language extension of java script
Typescript language extension of java scriptmichaelaaron25322
 
Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming  Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming WebStackAcademy
 
Thinkful - Intro to JavaScript
Thinkful - Intro to JavaScriptThinkful - Intro to JavaScript
Thinkful - Intro to JavaScriptTJ Stalcup
 
Intro to javascript (6:27)
Intro to javascript (6:27)Intro to javascript (6:27)
Intro to javascript (6:27)David Coulter
 
Intro to javascript (6:19)
Intro to javascript (6:19)Intro to javascript (6:19)
Intro to javascript (6:19)Thinkful
 
Moving From JavaScript to TypeScript: Things Developers Should Know
Moving From JavaScript to TypeScript: Things Developers Should KnowMoving From JavaScript to TypeScript: Things Developers Should Know
Moving From JavaScript to TypeScript: Things Developers Should KnowFibonalabs
 
Intro to javascript (5:2)
Intro to javascript (5:2)Intro to javascript (5:2)
Intro to javascript (5:2)Thinkful
 
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptxUnit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptxMalla Reddy University
 
typescript.pptx
typescript.pptxtypescript.pptx
typescript.pptxZeynepOtu
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScriptMarlon Jamera
 
Presentation 2nd
Presentation 2ndPresentation 2nd
Presentation 2ndConnex
 
Presentation 5th
Presentation 5thPresentation 5th
Presentation 5thConnex
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!Alessandro Giorgetti
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript Corley S.r.l.
 
Java Script
Java ScriptJava Script
Java ScriptSarvan15
 
Java Script
Java ScriptJava Script
Java ScriptSarvan15
 

Ähnlich wie Getting started with typescript and angular 2 (20)

An Introduction to TypeScript
An Introduction to TypeScriptAn Introduction to TypeScript
An Introduction to TypeScript
 
Typescript language extension of java script
Typescript language extension of java scriptTypescript language extension of java script
Typescript language extension of java script
 
Type script
Type scriptType script
Type script
 
Type script
Type scriptType script
Type script
 
Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming  Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming
 
Thinkful - Intro to JavaScript
Thinkful - Intro to JavaScriptThinkful - Intro to JavaScript
Thinkful - Intro to JavaScript
 
Intro to javascript (6:27)
Intro to javascript (6:27)Intro to javascript (6:27)
Intro to javascript (6:27)
 
Intro to javascript (6:19)
Intro to javascript (6:19)Intro to javascript (6:19)
Intro to javascript (6:19)
 
Moving From JavaScript to TypeScript: Things Developers Should Know
Moving From JavaScript to TypeScript: Things Developers Should KnowMoving From JavaScript to TypeScript: Things Developers Should Know
Moving From JavaScript to TypeScript: Things Developers Should Know
 
Intro to javascript (5:2)
Intro to javascript (5:2)Intro to javascript (5:2)
Intro to javascript (5:2)
 
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptxUnit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
 
typescript.pptx
typescript.pptxtypescript.pptx
typescript.pptx
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Presentation 2nd
Presentation 2ndPresentation 2nd
Presentation 2nd
 
Presentation 5th
Presentation 5thPresentation 5th
Presentation 5th
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript
 
Javascript
JavascriptJavascript
Javascript
 
Java Script
Java ScriptJava Script
Java Script
 
Java Script
Java ScriptJava Script
Java Script
 

Mehr von Knoldus Inc.

Supply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxSupply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxKnoldus Inc.
 
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingKnoldus Inc.
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionKnoldus Inc.
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxKnoldus Inc.
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptxKnoldus Inc.
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfKnoldus Inc.
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxKnoldus Inc.
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingKnoldus Inc.
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesKnoldus Inc.
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxKnoldus Inc.
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxKnoldus Inc.
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxKnoldus Inc.
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxKnoldus Inc.
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxKnoldus Inc.
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationKnoldus Inc.
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationKnoldus Inc.
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIsKnoldus Inc.
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II PresentationKnoldus Inc.
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAKnoldus Inc.
 

Mehr von Knoldus Inc. (20)

Supply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxSupply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptx
 
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On Introduction
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptx
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdf
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptx
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable Testing
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose Kubernetes
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptx
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptx
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptx
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptx
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake Presentation
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics Presentation
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II Presentation
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRA
 

Kürzlich hochgeladen

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 

Kürzlich hochgeladen (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 

Getting started with typescript and angular 2

  • 2. Agenda 1. What is TypeScript 2. Benefits 3. Typescript Vs. JavaScript 4. New features of Typescript 5. Installation 6. How to compile Typescript file 7. How to compile multiple Typescript file into a single js file 8. Enable the Typescript Compiler 9. Demo
  • 3. What is TypeScript ? • Type Script is a superset of JavaScript • Type Script is a free and open source programming language developed and maintained by Microsoft. • Type Script files are compiled to readable JavaScript
  • 4. Benefits • Big advantage of Typescript is we identify Type related issues early before going to production • You can even set the JS version that you want your resulting code on. • Typescript allows us to define new classes and new • Typescript is statically typed
  • 5. TypeScript Vs. JavaScript • JavaScript has ambiguity because of having no datatype declaration which is now possible in Type Script. It makes the code more understandable and easy • It allows us to use javascript as if an object oriented code which is much more clear than javascript due to its syntax. • Typescript include function overloading but javascript does not • TypeScript is optionally typed by default • For a large JavaScript project, adopting TypeScript might result in more robust software, while still being deployable where a regular JavaScript application would run.
  • 7. Type Annotation • The type annotation we can add to a variable we define, should come after the variable identified and should be preceded by a colon. • var id:number = 123123; • var name:string = "mosh"; • var tall:boolean = true;
  • 8. Dynamic Type • TypeScript is optionally statically typed programming language. The types are checked in order to preventassignment of invalid values in term of their types. • We can optionally change the variable into a dynamic one. var demo:any =5; demo =''john”; demo = new Object();
  • 9. Automatic Type Inferring • When assigning a variable, that was just created, with a value, the TypeScript execution environment automatically identifies the type and from that moment on the type of that variable is unchanged. • var demo = 1; • demo ='abc' // result in compilation error
  • 10. Type Eraser When compiling the TypeScript code into JavaScript all of the type annotations are removed. App.ts var a: number = 3; var b: string = 'abc'; App.js after Compilation var a = 3; var b = 'abc';
  • 11. Constructor • When we define a new class it automatically has a constructor. The default one. We can define a new constructor. When doing so, the default one will be deleted. • When we define a new constructor we can specify each one of its parameters with an access modifier and by doing so indirectly define those parameters as instance variables
  • 12. Constructor class Person { constructor(public name:String) { this.name = name;} greet():String={ return “my name is”+this.name); } } var person = new Person(“john); Console.log(person.greet);
  • 13. Interfaces(ts file) interface LabelledValue { label: string;} function printLabel(labelledObj: LabelledValue) { console.log(labelledObj.label) } let myObj = {size: 10, label: "Size 10 Object"}; printLabel(myObj); The interface LabelledValue is a name we can now use to describe the requirement in the previous example. • It still represents having a single property called label that is of type string. • Notice we didn’t have to explicitly say that the object we pass to printLabel implements this interface like we might have to in other languages. Here, it’s only the shape that matters. If the object we pass to the function meets the requirements listed, then it’s allowed.
  • 14. Function Overloading(.ts file) class Customer { name: string; Id: number; add(Id: number); add(name:string); add(value: any) { if (value && typeof value == "number") { //Do something } if (value && typeof value == "string") { //Do Something } } }
  • 15. Function Overloading(.js file) var Customer = (function () { function Customer() { } Customer.prototype.add = function (value) { if (value && typeof value == "number") { } if (value && typeof value == "string") { } }; return Customer; }());
  • 16. TypeScript Support Optional Properties In JavaScript, every parameter is considered optional. If no value is supplied, then it is treated as undefined. So while writing in TypeScript, we can make a parameter optional using the “?” after the parameter name. interface SquareConfig { color?: string;width?: number;} function createSquare(config: SquareConfig): {color: string; area: number} { let newSquare = {color: "white", area: 100}; if (config.color) { newSquare.color = config.color; } if (config.width) { newSquare.area = config.width * config.width; } return newSquare; } let mySquare = createSquare({color: "black"});
  • 17. How Do You Compile TypeScript Files? The extension for any TypeScript file is “.ts”. And any JavaScript file is TypeScript file as it is a superset of JavaScript. So change extension of “.js” to “.ts” file and your TypeScript file is ready. To compile any .ts file into .js, use the following command. tsc <TypeScript File Name> For example, to compile “Helloworld.ts”: • tsc helloworld.ts • And the result would be helloworld.js.
  • 18. Is It Possible to Combine Multiple .ts Files into a Single .js File? Yes, it's possible. While compiling add --outFILE [OutputJSFileName] option. • tsc --outFile comman.js file1.ts file2.ts file3.ts • This will compile all 3 “.ts” file and output into single “comman.js” file. And what will happen if you don’t provide a output file name. • tsc --outFile file1.ts file2.ts file3.ts • In this case, file2.ts and file3.ts will be compiled and the output will be placed in file1.ts. So now your file1.ts contains JavaScript code.
  • 19. How to install Typescript 1.Install git 2.Install nodejs 3.Install Typescript npm install -g typescript
  • 21. Working Example(func1.ts) class cust { name:string; Id:number; add(Id:number); add(name:string); add(value:any){ } } tsc --outFile comman.js func1.ts func.ts
  • 22. Working Example(comman.js) var customer = (function () { function customer(name) { this.name = name; } return customer; }()); var cust = (function () { function cust() { } cust.prototype.add = function (value) { }; return cust; }());
  • 23. Enabling the TypeScript Compiler In order to develop code in TypeScript using the PHPStorm or the WebStorm IDE we should perform following steps • In the Default Preferences setting window, enable the • TypeSciprt compiler, specifying the node interpreter and • specify the main file we want to compile.
  • 24.
  • 25. Designing a Demo.ts File class Demo{ name:String; constructor(name:String) { this.name = name;} display():String{ return "my name is"+name; } } var demo = new Demo("anubhav"); console.log(demo.display());
  • 26. Automatically Generated Demo.js File var Demo = (function () { function Demo(name) { this.name = name; } Demo.prototype.display = function () { return "my name is" + name; }; return Demo; }()); var demo = new Demo("anubhav"); console.log(demo.display())
  • 27. Working demo Angular 2 With TypeScript you can clone it from repo https://github.com/anubhav100/angular2.git .

Hinweis der Redaktion

  1. Well, it&amp;apos;s actually simple. Aurelia is just JavaScript. However, it&amp;apos;s not yesterday&amp;apos;s JavaScript, but the JavaScript of tomorrow. By using modern tooling we&amp;apos;ve been able to write Aurelia from the ground up in ECMAScript 2016. This means we have native modules, classes, decorators and more at our disposal...and you have them too.
  2. So, Aurelia is a set of modern, modular JavaScript libraries for building UI...and it&amp;apos;s open source. Great. There are other projects that might describe themselves in a similar way, so what makes Aurelia unique? Clean and Unobtrusive - Aurelia is the only framework that lets you build components with plain JavaScript. The framework stays out of your way so your code remains clean and easy to evolve over time. Convention over Configuration - Simple conventions help developers follow solid patterns and reduce the amount of code they have to write and maintain. It also means less fiddling with framework APIs and more focus on their app. Simple, But Not Simplistic - Aurelia is simple to learn, but extremely powerful. Because of the simple, consistent design, developers are able to learn a very small set of patterns and APIs that unlock limitless possibilities. Promotes the &amp;quot;-ilities&amp;quot; - Testability, maintainability, extensibility, learnability, etc. These are often referred to as the &amp;quot;-ilities&amp;quot;. Aurelia&amp;apos;s design helps developers naturally write code that exhibits these desirable characteristics. Amazingly Extensible - Aurelia is highly modular and designed to be customized easily. Almost every aspect of Aurelia is extensible, meaning developers will never hit a roadblock or have to &amp;quot;hack&amp;quot; the framework to succeed.
  3. However, it’s difficult to compare the two at this point because Angular 2.0 is not finished and we’ve only seen what has been work-in-progress. Therefore, I don’t think it’s too fair to do an apples-to-apples comparison.
  4. Piyush Mishra