SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
SHORT INTROTO ES6 FEATURES
- abbreviation of ECMA version 6
- currently at proposal and beta
- revolutionary changes
- ES 6 is fully compatible with ES5 (strict mode)
HISTORY
- In 1999, ECMAScript 3
- In 2005, ECMAScript 4
- In 2009, ECMAScript 5
- In 2011, ECMAScript 5.1
FEATURES
- let
- de-structuring
- default parameter
- rest parameter
- spread
- template
- arrow function
- shorthand object literal
- for….of
- Module
VAR LET
var doWork = function(flag){
if (flag){
var x = 3;
}
return x;
}
var doWork = function(flag){
if (flag){
let x = 3;
}
return x;
}
DE-STRUCTURING
var x = 3,y = 2;
var temp = x, x = y ,y = temp;
// y = 3 // x = 2
let x = 3, y = 2;
[x,y] = [y,x]; // x = 2, y = 3
[x,y,z] = [1,2]; // x = 1, y=2
[x,y,z] = [1,,3]; // x = 1, z=3
DEFAULT PARAMETER
function defaultIsRed(color) {
if(color==undefined) {
return "red";
} else {
return color;
}
}
function defaultIsRed(color) { return (color==undefined) ? "red" : color;}
function defaultIsRed(color=“red”) { return color;}
function add(x,y) {return x+y;}
REST PARAMETER
Case A
add(1,2); // 3
Call A
REST PARAMETER
Case B
function add(arr) {
var result =0;
for (var i in arr) {
result = arr[i];
}
return result;
}
Call B
var num = [1,2,3];
add(num); // 6
REST PARAMETER
Case C
function add() {
var result =0;
for (var i; i<=argument.length; i++) {
result = argument[i];
}
return result;
}
Call C
add(1,2,3); //6
function add(…numbers) {
var result =0;
for (var i; i<=numbers.length; i++) {
result = numbers[i];
}
return result;
}
REST PARAMETER
Case D
add(1,2,3); //6
Call D (ES6)
SPREAD
var a = [4,5,6];
var number = [1,2,3,…a,7,8,9];
console.log(number);
// [1,2,3,4,5,6,7,8,9]
TEMPLATE
ES5
ES6
var category = “music”;
var id = 2124;
var url = “http://api.server.me/“+category+”/“+id;
let category = “music”;
let id = 2124;
let url =`http://api.server.me/${category}/${id}`;
ARROW FUNCTIONS
Single Expression
Multiple Expression
function(x) { return x*x; } (x) => x*x;
var add = function(x,y) {
var temp = x+y;
return temp;

}
let add = (x,y) => {
var temp = x+y;
return temp;

}
SHORT HAND OBJECT LITERAL
ES5
ES6
var cat = “Molly”, dog = "Rex";
var pets = { 'cat': cat, 'dog': dog,}
var cat = "Molly";
var dog = "Rex";
var pets = {cat,dog}
FOR …. OF
for….of
for….in
var num = ['lorem','ipsum','dollar','sit'];
for (var i in num) {
console.log(num[i]); // i = 0,1,2,3,4
}
for (var i of num) {
console.log(i); //'lorem','ipsum','dollar','sit'
}
main.js
lib.js
MODULE
export const sqrt = Math.sqrt;
export function square(x) {
return x * x;
}
export function diag(x, y) {
return sqrt(square(x) + square(y));
}
import { square, diag } from 'lib';
console.log(square(11)); // 121
console.log(diag(4, 3)); // 5
- objects are reflection of classes
- objects can’t be existed without classes
- objects structures are defined by classes
most languages
In Javascript
- objects can be instantiated by assigning functions
- can set methods without declaring as skeleton
- there are several ways to create an object.
Object
var employee = function() {}
employee.prototype = {}
declaration
Set
employee.doWork = function() { return “Complete” }
employee.prototype = { doWork: function() {return “Complete”} }
Classes and Method
class Employee {
doWork(){
return "Complete";
}
}
var e = new Employee();
console.log(e.doWork()); //Complete
class Employee {
constructor(){
console.log(“Complete”);
}
}
var e = new Employee();
// Complete
Constructor
Setter and Getter
class Employee {
set name(n){ this._name = n; }
get name(){ return this._name;}
}
var e = new Employee();
e.name = "Slack";
console.log(e.name); //Slack
About Me
@kelvinm0rRis
nainglinaung
in/nainglinaung
developer at Aceplus Solutions

Más contenido relacionado

La actualidad más candente

Perl Bag of Tricks - Baltimore Perl mongers
Perl Bag of Tricks  -  Baltimore Perl mongersPerl Bag of Tricks  -  Baltimore Perl mongers
Perl Bag of Tricks - Baltimore Perl mongersbrian d foy
 
言語の設計判断
言語の設計判断言語の設計判断
言語の設計判断nishio
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giantsIan Barber
 
Inserindo em Ordem Crescente na Lista Encadeada
Inserindo em Ordem Crescente na Lista EncadeadaInserindo em Ordem Crescente na Lista Encadeada
Inserindo em Ordem Crescente na Lista EncadeadaElaine Cecília Gatto
 
OSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP hatersOSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP hatersLin Yo-An
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regexbrian d foy
 
The Joy of Smartmatch
The Joy of SmartmatchThe Joy of Smartmatch
The Joy of SmartmatchAndrew Shitov
 
Linux Awk cheat sheet and examples infographics
Linux Awk cheat sheet and examples infographicsLinux Awk cheat sheet and examples infographics
Linux Awk cheat sheet and examples infographicsabhiphull
 
The Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveThe Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveEleanor McHugh
 
Build a compiler in 2hrs - NCrafts Paris 2015
Build a compiler in 2hrs -  NCrafts Paris 2015Build a compiler in 2hrs -  NCrafts Paris 2015
Build a compiler in 2hrs - NCrafts Paris 2015Phillip Trelford
 
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6Workhorse Computing
 
The Magic Of Tie
The Magic Of TieThe Magic Of Tie
The Magic Of Tiebrian d foy
 
ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionIan Barber
 
On Functional Programming - A Clojurian Perspective
On Functional Programming - A Clojurian PerspectiveOn Functional Programming - A Clojurian Perspective
On Functional Programming - A Clojurian Perspectivelooselytyped
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges✅ William Pinaud
 

La actualidad más candente (20)

Perl Bag of Tricks - Baltimore Perl mongers
Perl Bag of Tricks  -  Baltimore Perl mongersPerl Bag of Tricks  -  Baltimore Perl mongers
Perl Bag of Tricks - Baltimore Perl mongers
 
言語の設計判断
言語の設計判断言語の設計判断
言語の設計判断
 
Javascript: The Important Bits
Javascript: The Important BitsJavascript: The Important Bits
Javascript: The Important Bits
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
 
Inserindo em Ordem Crescente na Lista Encadeada
Inserindo em Ordem Crescente na Lista EncadeadaInserindo em Ordem Crescente na Lista Encadeada
Inserindo em Ordem Crescente na Lista Encadeada
 
"let ECMAScript = 6"
"let ECMAScript = 6" "let ECMAScript = 6"
"let ECMAScript = 6"
 
OSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP hatersOSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP haters
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regex
 
Php&redis presentation
Php&redis presentationPhp&redis presentation
Php&redis presentation
 
Pdr ppt
Pdr pptPdr ppt
Pdr ppt
 
The Joy of Smartmatch
The Joy of SmartmatchThe Joy of Smartmatch
The Joy of Smartmatch
 
Bag of tricks
Bag of tricksBag of tricks
Bag of tricks
 
Linux Awk cheat sheet and examples infographics
Linux Awk cheat sheet and examples infographicsLinux Awk cheat sheet and examples infographics
Linux Awk cheat sheet and examples infographics
 
The Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveThe Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's Perspective
 
Build a compiler in 2hrs - NCrafts Paris 2015
Build a compiler in 2hrs -  NCrafts Paris 2015Build a compiler in 2hrs -  NCrafts Paris 2015
Build a compiler in 2hrs - NCrafts Paris 2015
 
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
 
The Magic Of Tie
The Magic Of TieThe Magic Of Tie
The Magic Of Tie
 
ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 Version
 
On Functional Programming - A Clojurian Perspective
On Functional Programming - A Clojurian PerspectiveOn Functional Programming - A Clojurian Perspective
On Functional Programming - A Clojurian Perspective
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges
 

Destacado

Intro to ES6 and why should you bother !
Intro to ES6 and why should you bother !Intro to ES6 and why should you bother !
Intro to ES6 and why should you bother !Gaurav Behere
 
Javascript Best Practice
Javascript Best Practice Javascript Best Practice
Javascript Best Practice Naing Lin Aung
 
Javascript and Jquery Best practices
Javascript and Jquery Best practicesJavascript and Jquery Best practices
Javascript and Jquery Best practicesSultan Khan
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmineTimothy Oxley
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented JavascriptIban Martinez
 

Destacado (8)

Intro to ES6 and why should you bother !
Intro to ES6 and why should you bother !Intro to ES6 and why should you bother !
Intro to ES6 and why should you bother !
 
Javascript Best Practice
Javascript Best Practice Javascript Best Practice
Javascript Best Practice
 
ES6: Features + Rails
ES6: Features + RailsES6: Features + Rails
ES6: Features + Rails
 
Javascript and Jquery Best practices
Javascript and Jquery Best practicesJavascript and Jquery Best practices
Javascript and Jquery Best practices
 
Intro to ES6 / ES2015
Intro to ES6 / ES2015Intro to ES6 / ES2015
Intro to ES6 / ES2015
 
10 Useful New Features of ECMA Script 6
10 Useful New Features of ECMA Script 610 Useful New Features of ECMA Script 6
10 Useful New Features of ECMA Script 6
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascript
 

Similar a ES6 Features in 40 Characters

JavaScript - new features in ECMAScript 6
JavaScript - new features in ECMAScript 6JavaScript - new features in ECMAScript 6
JavaScript - new features in ECMAScript 6Solution4Future
 
Adding ES6 to Your Developer Toolbox
Adding ES6 to Your Developer ToolboxAdding ES6 to Your Developer Toolbox
Adding ES6 to Your Developer ToolboxJeff Strauss
 
An Intro To ES6
An Intro To ES6An Intro To ES6
An Intro To ES6FITC
 
ECMAScript2015
ECMAScript2015ECMAScript2015
ECMAScript2015qmmr
 
Impress Your Friends with EcmaScript 2015
Impress Your Friends with EcmaScript 2015Impress Your Friends with EcmaScript 2015
Impress Your Friends with EcmaScript 2015Lukas Ruebbelke
 
ES6 and AngularAMD
ES6 and AngularAMDES6 and AngularAMD
ES6 and AngularAMDdhaval10690
 
ESCMAScript 6: Get Ready For The Future. Now
ESCMAScript 6: Get Ready For The Future. NowESCMAScript 6: Get Ready For The Future. Now
ESCMAScript 6: Get Ready For The Future. NowKrzysztof Szafranek
 
Essentials and Impactful Features of ES6
Essentials and Impactful Features of ES6Essentials and Impactful Features of ES6
Essentials and Impactful Features of ES6Riza Fahmi
 
Idiomatic Javascript (ES5 to ES2015+)
Idiomatic Javascript (ES5 to ES2015+)Idiomatic Javascript (ES5 to ES2015+)
Idiomatic Javascript (ES5 to ES2015+)David Atchley
 
Javascript basics
Javascript basicsJavascript basics
Javascript basicsFin Chen
 
Introduction to ES6 with Tommy Cresine
Introduction to ES6 with Tommy CresineIntroduction to ES6 with Tommy Cresine
Introduction to ES6 with Tommy CresineMovel
 
ES6 Simplified
ES6 SimplifiedES6 Simplified
ES6 SimplifiedCarlos Ble
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Seri Moth
 

Similar a ES6 Features in 40 Characters (20)

JavaScript - new features in ECMAScript 6
JavaScript - new features in ECMAScript 6JavaScript - new features in ECMAScript 6
JavaScript - new features in ECMAScript 6
 
Adding ES6 to Your Developer Toolbox
Adding ES6 to Your Developer ToolboxAdding ES6 to Your Developer Toolbox
Adding ES6 to Your Developer Toolbox
 
An Intro To ES6
An Intro To ES6An Intro To ES6
An Intro To ES6
 
ECMAScript2015
ECMAScript2015ECMAScript2015
ECMAScript2015
 
Impress Your Friends with EcmaScript 2015
Impress Your Friends with EcmaScript 2015Impress Your Friends with EcmaScript 2015
Impress Your Friends with EcmaScript 2015
 
Es6 hackathon
Es6 hackathonEs6 hackathon
Es6 hackathon
 
ES6 and AngularAMD
ES6 and AngularAMDES6 and AngularAMD
ES6 and AngularAMD
 
Workshop 10: ECMAScript 6
Workshop 10: ECMAScript 6Workshop 10: ECMAScript 6
Workshop 10: ECMAScript 6
 
ES6: The Awesome Parts
ES6: The Awesome PartsES6: The Awesome Parts
ES6: The Awesome Parts
 
ESCMAScript 6: Get Ready For The Future. Now
ESCMAScript 6: Get Ready For The Future. NowESCMAScript 6: Get Ready For The Future. Now
ESCMAScript 6: Get Ready For The Future. Now
 
Essentials and Impactful Features of ES6
Essentials and Impactful Features of ES6Essentials and Impactful Features of ES6
Essentials and Impactful Features of ES6
 
Idiomatic Javascript (ES5 to ES2015+)
Idiomatic Javascript (ES5 to ES2015+)Idiomatic Javascript (ES5 to ES2015+)
Idiomatic Javascript (ES5 to ES2015+)
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
 
Introduction to ES6 with Tommy Cresine
Introduction to ES6 with Tommy CresineIntroduction to ES6 with Tommy Cresine
Introduction to ES6 with Tommy Cresine
 
ES6: The future is now
ES6: The future is nowES6: The future is now
ES6: The future is now
 
Es6 to es5
Es6 to es5Es6 to es5
Es6 to es5
 
ES6 Simplified
ES6 SimplifiedES6 Simplified
ES6 Simplified
 
Internal workshop es6_2015
Internal workshop es6_2015Internal workshop es6_2015
Internal workshop es6_2015
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02
 
Javascript
JavascriptJavascript
Javascript
 

Último

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

ES6 Features in 40 Characters

  • 1. SHORT INTROTO ES6 FEATURES - abbreviation of ECMA version 6 - currently at proposal and beta - revolutionary changes - ES 6 is fully compatible with ES5 (strict mode)
  • 2. HISTORY - In 1999, ECMAScript 3 - In 2005, ECMAScript 4 - In 2009, ECMAScript 5 - In 2011, ECMAScript 5.1
  • 3. FEATURES - let - de-structuring - default parameter - rest parameter - spread - template - arrow function - shorthand object literal - for….of - Module
  • 4. VAR LET var doWork = function(flag){ if (flag){ var x = 3; } return x; } var doWork = function(flag){ if (flag){ let x = 3; } return x; }
  • 5. DE-STRUCTURING var x = 3,y = 2; var temp = x, x = y ,y = temp; // y = 3 // x = 2 let x = 3, y = 2; [x,y] = [y,x]; // x = 2, y = 3 [x,y,z] = [1,2]; // x = 1, y=2 [x,y,z] = [1,,3]; // x = 1, z=3
  • 6. DEFAULT PARAMETER function defaultIsRed(color) { if(color==undefined) { return "red"; } else { return color; } } function defaultIsRed(color) { return (color==undefined) ? "red" : color;} function defaultIsRed(color=“red”) { return color;}
  • 7. function add(x,y) {return x+y;} REST PARAMETER Case A add(1,2); // 3 Call A
  • 8. REST PARAMETER Case B function add(arr) { var result =0; for (var i in arr) { result = arr[i]; } return result; } Call B var num = [1,2,3]; add(num); // 6
  • 9. REST PARAMETER Case C function add() { var result =0; for (var i; i<=argument.length; i++) { result = argument[i]; } return result; } Call C add(1,2,3); //6
  • 10. function add(…numbers) { var result =0; for (var i; i<=numbers.length; i++) { result = numbers[i]; } return result; } REST PARAMETER Case D add(1,2,3); //6 Call D (ES6)
  • 11. SPREAD var a = [4,5,6]; var number = [1,2,3,…a,7,8,9]; console.log(number); // [1,2,3,4,5,6,7,8,9]
  • 12. TEMPLATE ES5 ES6 var category = “music”; var id = 2124; var url = “http://api.server.me/“+category+”/“+id; let category = “music”; let id = 2124; let url =`http://api.server.me/${category}/${id}`;
  • 13. ARROW FUNCTIONS Single Expression Multiple Expression function(x) { return x*x; } (x) => x*x; var add = function(x,y) { var temp = x+y; return temp;
 } let add = (x,y) => { var temp = x+y; return temp;
 }
  • 14. SHORT HAND OBJECT LITERAL ES5 ES6 var cat = “Molly”, dog = "Rex"; var pets = { 'cat': cat, 'dog': dog,} var cat = "Molly"; var dog = "Rex"; var pets = {cat,dog}
  • 15. FOR …. OF for….of for….in var num = ['lorem','ipsum','dollar','sit']; for (var i in num) { console.log(num[i]); // i = 0,1,2,3,4 } for (var i of num) { console.log(i); //'lorem','ipsum','dollar','sit' }
  • 16. main.js lib.js MODULE export const sqrt = Math.sqrt; export function square(x) { return x * x; } export function diag(x, y) { return sqrt(square(x) + square(y)); } import { square, diag } from 'lib'; console.log(square(11)); // 121 console.log(diag(4, 3)); // 5
  • 17. - objects are reflection of classes - objects can’t be existed without classes - objects structures are defined by classes most languages In Javascript - objects can be instantiated by assigning functions - can set methods without declaring as skeleton - there are several ways to create an object.
  • 18. Object var employee = function() {} employee.prototype = {} declaration Set employee.doWork = function() { return “Complete” } employee.prototype = { doWork: function() {return “Complete”} }
  • 19. Classes and Method class Employee { doWork(){ return "Complete"; } } var e = new Employee(); console.log(e.doWork()); //Complete class Employee { constructor(){ console.log(“Complete”); } } var e = new Employee(); // Complete Constructor Setter and Getter class Employee { set name(n){ this._name = n; } get name(){ return this._name;} } var e = new Employee(); e.name = "Slack"; console.log(e.name); //Slack