SlideShare una empresa de Scribd logo
1 de 14
Descargar para leer sin conexión
ECMAScript 6 Harmony
Major Changes
• class, module
• ‘const’,‘let’, destructuring
• for of
• Iterator and generator
• Default parameter
• Rest parameter and spread
• Arrow function
• Map, Set,WeakMap
• Array comprehension
• Proxy
• String extra, quasi-string literal
• Binary, octet, unicode literal
class, module
• class, extends
• constructor
• super
• module
• import, export
import $ from “jQuery”;
module “point” {
export class PointT extends Time {
constructor(x, y, t) {
super(t);
public getX() { return x; }
public getY() { return y; }
}
toString() {
return '<' + this.getX() + ',' + this.getY() + '>';
}
}
}
import PointT from “point”;
‘const’,‘let’, destructuring
• const
• let
• [x, y] = [y, x]
function Point5(x, y) {
const offset = 5;
if (x < offset) {
let y = 1;
x += y;
}
[x, y] = [ x+offset, y + offset];
return {x: x, y: y};
}
for of
• for (n of [ 1, 2, 3, 4, 5]) function Point6(x, y) {
var r = [1, 2, 3, 4, 5, 6, 7, 8, 9];
for (n of r) {
y = x + n;
}
return y;
}
Iterator and generator
• Iterator()
• #.next()
• yield
function Range(low, high) {
this.low = low;
this.high = high;
}
function RangeIterator(range) {
this.range = range;
this.current = this.range.low;
}
RangeIterator.prototype.next = function() {
if (this.current > this.range.high)
throw StopIteration;
else
return this.current++;
};
Range.prototype.__iterator__ = function() {
return new RangeIterator(this);
};
var range = new Range(3, 5);
for (var i in range) console.log(i);
function Range(low, high){
this.low = low;
this.high = high;
}
Range.prototype.__iterator__ = function(){
for (var i = this.low; i <= this.high; i++)
yield i;
};
Default parameter
• function (x=2) { } function Point7(x = 0, y = 0) {
return { x: x, y: y };
}
var p = Point7();
Rest parameter and spread
• function (...z) { }
• [1, 2, 3, ...[5, 6, 7]]
• f(...[2, 4, 6])
function f(w, x, y, z) {
return w * 1000 + x * 100 + y * 10 + z;
}
function g(...v) {
var w = v.length > 0 ? v[0] : 0;
var x = v.length > 1 ? v[1] : 0;
var y = v.length > 2 ? v[2] : 0;
var z = v.length > 3 ? v[3] : 0;
return w * 1000 + x * 100 + y * 10 + z;
}
var p = [2, 4, 6];
var q = [5, 7, ...p];
console.log(f(2,4,6,0));
console.log(g(2,4,6));
console.log(g(...q));
Arrow function
• function (a, b) { return a * b; }
• (a, b) => { a * b; }
• (a, b) => a * b;
• x => x * 3;
• () => {};
let empty = () => {};
 
let identity = x => x;
 
let square = x => x * x;
 
let key_maker = val => ({key: val});
 
let odds = evens.map(v => v + 1);
 
let fives = [];
nats.forEach(v => { if (v % 5 === 0) fives.push(v); });
 
const obj = {
method: function () {
return () => this;
}
};
assert(obj.method()() === obj);
Map, Set,WeakMap
• new Map()
• new Set()
• new WeakMap()
var m = new Map();
var s = new Set();
var w = new WeakMap();
var ko = {}, kf = function(){};
m.set(ko “object”);
m.set(kf,“function”);
m.set(“a”,“string”);
m.size == 3;
m.get(“a”);
m.get(ko);
m.get(kf);
s.set(5);
s.set(“string”);
s.size == 2;
s.has(5);
for (var n of s) console.log(n);
Array comprehension
• [n for (n of [5, 6, 7])] var a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
var b = [n*2 for (n of a)];
var c = [n for (n of a) if (n % 2)];
var d = [i+j for (i of a) for (j of a)];
Proxy
• new Proxy({}, {}) var handler = {
get: function(target, name){
return name in target?
target[name] :
37;
}
};
var p = new Proxy({}, handler);
p.a = 1;
p.b = undefined;
console.log(p.a, p.b); // 1, undefined
console.log('c' in p, p.c); // false, 37
String extra, quasi-string literal
• startsWith
• endsWith
• contains
• toArray
• f`hello ${name}`
var s = “String extra, quasi-string literal”;
s.startsWith(“String”) == true;
s.endsWith(“literal”) == true;
s.contains(“quasi”) == true;
s.toArray();
function f(s) {
console.log(s);
return s;
}
var name = “everyone”;
f`hello ${name}.`;
Binary, octet, unicode literal
• 0b010101
• 0o77
• 'u{1d306}' == 'ud834udf06'

Más contenido relacionado

La actualidad más candente

OpenOpt の線形計画で圧縮センシング
OpenOpt の線形計画で圧縮センシングOpenOpt の線形計画で圧縮センシング
OpenOpt の線形計画で圧縮センシングToshihiro Kamishima
 
Numerical Method Assignment
Numerical Method AssignmentNumerical Method Assignment
Numerical Method Assignmentashikul akash
 
Wap in c to draw a line using DDA algorithm
Wap in c to draw a line using DDA algorithmWap in c to draw a line using DDA algorithm
Wap in c to draw a line using DDA algorithmKapil Pandit
 
Superficies en maple
Superficies en mapleSuperficies en maple
Superficies en mapleaart07
 
computer graphics practicals
computer graphics practicalscomputer graphics practicals
computer graphics practicalsManoj Chauhan
 
Pybelsberg — Constraint-based Programming in Python
Pybelsberg — Constraint-based Programming in PythonPybelsberg — Constraint-based Programming in Python
Pybelsberg — Constraint-based Programming in PythonChristoph Matthies
 
ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions Dr. Volkan OBAN
 
Ejercicios de programacion
Ejercicios de programacionEjercicios de programacion
Ejercicios de programacionJeff Tu Pechito
 
Deep learning study 3
Deep learning study 3Deep learning study 3
Deep learning study 3San Kim
 
imager package in R and examples..
imager package in R and examples..imager package in R and examples..
imager package in R and examples..Dr. Volkan OBAN
 
The Ring programming language version 1.5.1 book - Part 51 of 180
The Ring programming language version 1.5.1 book - Part 51 of 180The Ring programming language version 1.5.1 book - Part 51 of 180
The Ring programming language version 1.5.1 book - Part 51 of 180Mahmoud Samir Fayed
 

La actualidad más candente (20)

OpenOpt の線形計画で圧縮センシング
OpenOpt の線形計画で圧縮センシングOpenOpt の線形計画で圧縮センシング
OpenOpt の線形計画で圧縮センシング
 
Vcs9
Vcs9Vcs9
Vcs9
 
C questions
C questionsC questions
C questions
 
Numerical Method Assignment
Numerical Method AssignmentNumerical Method Assignment
Numerical Method Assignment
 
Wap in c to draw a line using DDA algorithm
Wap in c to draw a line using DDA algorithmWap in c to draw a line using DDA algorithm
Wap in c to draw a line using DDA algorithm
 
Superficies en maple
Superficies en mapleSuperficies en maple
Superficies en maple
 
R meets Hadoop
R meets HadoopR meets Hadoop
R meets Hadoop
 
C++ TUTORIAL 7
C++ TUTORIAL 7C++ TUTORIAL 7
C++ TUTORIAL 7
 
computer graphics practicals
computer graphics practicalscomputer graphics practicals
computer graphics practicals
 
Computer graphics
Computer graphics   Computer graphics
Computer graphics
 
Pybelsberg — Constraint-based Programming in Python
Pybelsberg — Constraint-based Programming in PythonPybelsberg — Constraint-based Programming in Python
Pybelsberg — Constraint-based Programming in Python
 
ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions
 
JVM Architecture - Java
JVM Architecture - JavaJVM Architecture - Java
JVM Architecture - Java
 
RHadoop の紹介
RHadoop の紹介RHadoop の紹介
RHadoop の紹介
 
Ejercicios de programacion
Ejercicios de programacionEjercicios de programacion
Ejercicios de programacion
 
Deep learning study 3
Deep learning study 3Deep learning study 3
Deep learning study 3
 
imager package in R and examples..
imager package in R and examples..imager package in R and examples..
imager package in R and examples..
 
The Ring programming language version 1.5.1 book - Part 51 of 180
The Ring programming language version 1.5.1 book - Part 51 of 180The Ring programming language version 1.5.1 book - Part 51 of 180
The Ring programming language version 1.5.1 book - Part 51 of 180
 
Caropro
CaroproCaropro
Caropro
 
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
 

Destacado

Let's get agile: An Agile Talk About Agile
Let's get agile: An Agile Talk About AgileLet's get agile: An Agile Talk About Agile
Let's get agile: An Agile Talk About AgileJesse Houwing
 
Case Study: Enhancing Sponsor Value through the Extension of Vendor-provided ...
Case Study: Enhancing Sponsor Value through the Extension of Vendor-provided ...Case Study: Enhancing Sponsor Value through the Extension of Vendor-provided ...
Case Study: Enhancing Sponsor Value through the Extension of Vendor-provided ...Kevin Shea
 
Expande tu Negocio con Email Marketing
Expande tu Negocio con Email MarketingExpande tu Negocio con Email Marketing
Expande tu Negocio con Email MarketingArmando Ehrenzweig
 
Lg15fall cara à cara30octf
Lg15fall cara à cara30octfLg15fall cara à cara30octf
Lg15fall cara à cara30octfkatherine watson
 
Campamentos de Verano Sierra de Cadiz Aula Naturaleza y Granja Escuela
Campamentos de Verano Sierra de Cadiz Aula Naturaleza y Granja EscuelaCampamentos de Verano Sierra de Cadiz Aula Naturaleza y Granja Escuela
Campamentos de Verano Sierra de Cadiz Aula Naturaleza y Granja EscuelaVeleta3000
 
Presentacion pp calafate y glaciar perito moreno
Presentacion pp calafate y glaciar perito morenoPresentacion pp calafate y glaciar perito moreno
Presentacion pp calafate y glaciar perito morenosilviaoswald
 
Relaciones Públicas. 2.0: El uso de los medios sociales en la estrategia de c...
Relaciones Públicas. 2.0: El uso de los medios sociales en la estrategia de c...Relaciones Públicas. 2.0: El uso de los medios sociales en la estrategia de c...
Relaciones Públicas. 2.0: El uso de los medios sociales en la estrategia de c...Anibal Leon Fernandez
 
Government Publications August 2015 Library Guide (4)
Government Publications August 2015 Library Guide (4)Government Publications August 2015 Library Guide (4)
Government Publications August 2015 Library Guide (4)Mary Howrey
 
Povertyy education
Povertyy educationPovertyy education
Povertyy educationTARIQ KHAN
 
European flags
European flagsEuropean flags
European flagsivid1990
 
Boletim Dom Edilberto - outubro/2013 - nº 56
Boletim Dom Edilberto - outubro/2013 - nº 56Boletim Dom Edilberto - outubro/2013 - nº 56
Boletim Dom Edilberto - outubro/2013 - nº 56escoladomedilberto
 
Glosario ecologia y calentmiento
Glosario ecologia y calentmientoGlosario ecologia y calentmiento
Glosario ecologia y calentmientoDeuglissabino
 
Ansiedad y angustia
Ansiedad y angustiaAnsiedad y angustia
Ansiedad y angustiaeduarfrasa
 
Flipping the Classroom with McGraw-Hill Connect - Dana'e Quirk-Dorr
Flipping the Classroom with McGraw-Hill Connect - Dana'e Quirk-DorrFlipping the Classroom with McGraw-Hill Connect - Dana'e Quirk-Dorr
Flipping the Classroom with McGraw-Hill Connect - Dana'e Quirk-Dorrmhhighered
 
Conceptos
ConceptosConceptos
Conceptosnay_isa
 
Actividad de aprendisaje nª 8
Actividad de aprendisaje nª 8Actividad de aprendisaje nª 8
Actividad de aprendisaje nª 8migelx
 
El futuro de_la_comunicacion_1_
El futuro de_la_comunicacion_1_El futuro de_la_comunicacion_1_
El futuro de_la_comunicacion_1_leslyevqz
 

Destacado (20)

Let's get agile: An Agile Talk About Agile
Let's get agile: An Agile Talk About AgileLet's get agile: An Agile Talk About Agile
Let's get agile: An Agile Talk About Agile
 
Case Study: Enhancing Sponsor Value through the Extension of Vendor-provided ...
Case Study: Enhancing Sponsor Value through the Extension of Vendor-provided ...Case Study: Enhancing Sponsor Value through the Extension of Vendor-provided ...
Case Study: Enhancing Sponsor Value through the Extension of Vendor-provided ...
 
Expande tu Negocio con Email Marketing
Expande tu Negocio con Email MarketingExpande tu Negocio con Email Marketing
Expande tu Negocio con Email Marketing
 
Lg15fall cara à cara30octf
Lg15fall cara à cara30octfLg15fall cara à cara30octf
Lg15fall cara à cara30octf
 
Campamentos de Verano Sierra de Cadiz Aula Naturaleza y Granja Escuela
Campamentos de Verano Sierra de Cadiz Aula Naturaleza y Granja EscuelaCampamentos de Verano Sierra de Cadiz Aula Naturaleza y Granja Escuela
Campamentos de Verano Sierra de Cadiz Aula Naturaleza y Granja Escuela
 
Presentacion pp calafate y glaciar perito moreno
Presentacion pp calafate y glaciar perito morenoPresentacion pp calafate y glaciar perito moreno
Presentacion pp calafate y glaciar perito moreno
 
Relaciones Públicas. 2.0: El uso de los medios sociales en la estrategia de c...
Relaciones Públicas. 2.0: El uso de los medios sociales en la estrategia de c...Relaciones Públicas. 2.0: El uso de los medios sociales en la estrategia de c...
Relaciones Públicas. 2.0: El uso de los medios sociales en la estrategia de c...
 
Government Publications August 2015 Library Guide (4)
Government Publications August 2015 Library Guide (4)Government Publications August 2015 Library Guide (4)
Government Publications August 2015 Library Guide (4)
 
Povertyy education
Povertyy educationPovertyy education
Povertyy education
 
European flags
European flagsEuropean flags
European flags
 
Boletim Dom Edilberto - outubro/2013 - nº 56
Boletim Dom Edilberto - outubro/2013 - nº 56Boletim Dom Edilberto - outubro/2013 - nº 56
Boletim Dom Edilberto - outubro/2013 - nº 56
 
Glosario ecologia y calentmiento
Glosario ecologia y calentmientoGlosario ecologia y calentmiento
Glosario ecologia y calentmiento
 
Ansiedad y angustia
Ansiedad y angustiaAnsiedad y angustia
Ansiedad y angustia
 
Flipping the Classroom with McGraw-Hill Connect - Dana'e Quirk-Dorr
Flipping the Classroom with McGraw-Hill Connect - Dana'e Quirk-DorrFlipping the Classroom with McGraw-Hill Connect - Dana'e Quirk-Dorr
Flipping the Classroom with McGraw-Hill Connect - Dana'e Quirk-Dorr
 
Conceptos
ConceptosConceptos
Conceptos
 
Tarea 8
Tarea 8Tarea 8
Tarea 8
 
Actividad de aprendisaje nª 8
Actividad de aprendisaje nª 8Actividad de aprendisaje nª 8
Actividad de aprendisaje nª 8
 
Fluoxetine 2002
Fluoxetine 2002Fluoxetine 2002
Fluoxetine 2002
 
Damai residences and lifestyle
Damai residences and lifestyleDamai residences and lifestyle
Damai residences and lifestyle
 
El futuro de_la_comunicacion_1_
El futuro de_la_comunicacion_1_El futuro de_la_comunicacion_1_
El futuro de_la_comunicacion_1_
 

Similar a ECMAScript 6 major changes

Bindings: the zen of montage
Bindings: the zen of montageBindings: the zen of montage
Bindings: the zen of montageKris Kowal
 
ES6 and AngularAMD
ES6 and AngularAMDES6 and AngularAMD
ES6 and AngularAMDdhaval10690
 
Create a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdfCreate a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdfarihantmobileselepun
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript IntroductionDmitry Sheiko
 
Javascript Uncommon Programming
Javascript Uncommon ProgrammingJavascript Uncommon Programming
Javascript Uncommon Programmingjeffz
 
package chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdfpackage chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdfKARTIKINDIA
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring CanvasKevin Hoyt
 
Paperjs presentation
Paperjs presentationPaperjs presentation
Paperjs presentationsharp-blade
 
Python 101 language features and functional programming
Python 101 language features and functional programmingPython 101 language features and functional programming
Python 101 language features and functional programmingLukasz Dynowski
 
Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript (中文)Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript (中文)jeffz
 
関数潮流(Function Tendency)
関数潮流(Function Tendency)関数潮流(Function Tendency)
関数潮流(Function Tendency)riue
 
Chapter 7 functions (c)
Chapter 7 functions (c)Chapter 7 functions (c)
Chapter 7 functions (c)hhliu
 
深入浅出Jscex
深入浅出Jscex深入浅出Jscex
深入浅出Jscexjeffz
 
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽tbosstraining
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manualUma mohan
 

Similar a ECMAScript 6 major changes (20)

Bindings: the zen of montage
Bindings: the zen of montageBindings: the zen of montage
Bindings: the zen of montage
 
ES6 and AngularAMD
ES6 and AngularAMDES6 and AngularAMD
ES6 and AngularAMD
 
Create a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdfCreate a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdf
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
Javascript Uncommon Programming
Javascript Uncommon ProgrammingJavascript Uncommon Programming
Javascript Uncommon Programming
 
package chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdfpackage chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdf
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring Canvas
 
ES6 Overview
ES6 OverviewES6 Overview
ES6 Overview
 
Paperjs presentation
Paperjs presentationPaperjs presentation
Paperjs presentation
 
Python 101 language features and functional programming
Python 101 language features and functional programmingPython 101 language features and functional programming
Python 101 language features and functional programming
 
EcmaScript 6
EcmaScript 6 EcmaScript 6
EcmaScript 6
 
Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript (中文)Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript (中文)
 
Javascript
JavascriptJavascript
Javascript
 
関数潮流(Function Tendency)
関数潮流(Function Tendency)関数潮流(Function Tendency)
関数潮流(Function Tendency)
 
Chapter 7 functions (c)
Chapter 7 functions (c)Chapter 7 functions (c)
Chapter 7 functions (c)
 
深入浅出Jscex
深入浅出Jscex深入浅出Jscex
深入浅出Jscex
 
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽
 
SDC - Einführung in Scala
SDC - Einführung in ScalaSDC - Einführung in Scala
SDC - Einführung in Scala
 
ES6, WTF?
ES6, WTF?ES6, WTF?
ES6, WTF?
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 

Último

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Último (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

ECMAScript 6 major changes

  • 2. Major Changes • class, module • ‘const’,‘let’, destructuring • for of • Iterator and generator • Default parameter • Rest parameter and spread • Arrow function • Map, Set,WeakMap • Array comprehension • Proxy • String extra, quasi-string literal • Binary, octet, unicode literal
  • 3. class, module • class, extends • constructor • super • module • import, export import $ from “jQuery”; module “point” { export class PointT extends Time { constructor(x, y, t) { super(t); public getX() { return x; } public getY() { return y; } } toString() { return '<' + this.getX() + ',' + this.getY() + '>'; } } } import PointT from “point”;
  • 4. ‘const’,‘let’, destructuring • const • let • [x, y] = [y, x] function Point5(x, y) { const offset = 5; if (x < offset) { let y = 1; x += y; } [x, y] = [ x+offset, y + offset]; return {x: x, y: y}; }
  • 5. for of • for (n of [ 1, 2, 3, 4, 5]) function Point6(x, y) { var r = [1, 2, 3, 4, 5, 6, 7, 8, 9]; for (n of r) { y = x + n; } return y; }
  • 6. Iterator and generator • Iterator() • #.next() • yield function Range(low, high) { this.low = low; this.high = high; } function RangeIterator(range) { this.range = range; this.current = this.range.low; } RangeIterator.prototype.next = function() { if (this.current > this.range.high) throw StopIteration; else return this.current++; }; Range.prototype.__iterator__ = function() { return new RangeIterator(this); }; var range = new Range(3, 5); for (var i in range) console.log(i); function Range(low, high){ this.low = low; this.high = high; } Range.prototype.__iterator__ = function(){ for (var i = this.low; i <= this.high; i++) yield i; };
  • 7. Default parameter • function (x=2) { } function Point7(x = 0, y = 0) { return { x: x, y: y }; } var p = Point7();
  • 8. Rest parameter and spread • function (...z) { } • [1, 2, 3, ...[5, 6, 7]] • f(...[2, 4, 6]) function f(w, x, y, z) { return w * 1000 + x * 100 + y * 10 + z; } function g(...v) { var w = v.length > 0 ? v[0] : 0; var x = v.length > 1 ? v[1] : 0; var y = v.length > 2 ? v[2] : 0; var z = v.length > 3 ? v[3] : 0; return w * 1000 + x * 100 + y * 10 + z; } var p = [2, 4, 6]; var q = [5, 7, ...p]; console.log(f(2,4,6,0)); console.log(g(2,4,6)); console.log(g(...q));
  • 9. Arrow function • function (a, b) { return a * b; } • (a, b) => { a * b; } • (a, b) => a * b; • x => x * 3; • () => {}; let empty = () => {};   let identity = x => x;   let square = x => x * x;   let key_maker = val => ({key: val});   let odds = evens.map(v => v + 1);   let fives = []; nats.forEach(v => { if (v % 5 === 0) fives.push(v); });   const obj = { method: function () { return () => this; } }; assert(obj.method()() === obj);
  • 10. Map, Set,WeakMap • new Map() • new Set() • new WeakMap() var m = new Map(); var s = new Set(); var w = new WeakMap(); var ko = {}, kf = function(){}; m.set(ko “object”); m.set(kf,“function”); m.set(“a”,“string”); m.size == 3; m.get(“a”); m.get(ko); m.get(kf); s.set(5); s.set(“string”); s.size == 2; s.has(5); for (var n of s) console.log(n);
  • 11. Array comprehension • [n for (n of [5, 6, 7])] var a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; var b = [n*2 for (n of a)]; var c = [n for (n of a) if (n % 2)]; var d = [i+j for (i of a) for (j of a)];
  • 12. Proxy • new Proxy({}, {}) var handler = { get: function(target, name){ return name in target? target[name] : 37; } }; var p = new Proxy({}, handler); p.a = 1; p.b = undefined; console.log(p.a, p.b); // 1, undefined console.log('c' in p, p.c); // false, 37
  • 13. String extra, quasi-string literal • startsWith • endsWith • contains • toArray • f`hello ${name}` var s = “String extra, quasi-string literal”; s.startsWith(“String”) == true; s.endsWith(“literal”) == true; s.contains(“quasi”) == true; s.toArray(); function f(s) { console.log(s); return s; } var name = “everyone”; f`hello ${name}.`;
  • 14. Binary, octet, unicode literal • 0b010101 • 0o77 • 'u{1d306}' == 'ud834udf06'