Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ecmascript 2015
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Benjamin
July 03, 2015
Programming
59
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ecmascript 2015
Benjamin
July 03, 2015
More Decks by Benjamin
See All by Benjamin
Intégrer Cordova dans une appli native
benjmichel
0
92
Other Decks in Programming
See All in Programming
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
240
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
4.9k
運用ダッシュボードの設計を誰も教えてくれないのだけどみなさんどうしてるんですか? - チームに監視するという文化を根付かせるための第一歩を踏みたい -
satoshi256kbyte
1
140
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
250
FDEが実現するAI駆動経営の現在地
gonta
2
290
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
6.6k
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
740
170k Jobs a Day on GKE: Scaling Mercari's CI Platform - and What's Next for AI-Native Development
junyaokabe
0
120
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
530
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.6k
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
320
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.1k
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
870
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The SEO Collaboration Effect
kristinabergwall1
1
520
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
650
Color Theory Basics | Prateek | Gurzu
gurzu
0
430
Automating Front-end Workflow
addyosmani
1369
210k
Practical Orchestrator
shlominoach
191
12k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
480
Transcript
ECMAScript 2015 Benjamin MICHEL 03/07/2015
What is ECMASript ? • a scripting language • standardized
by Ecma International • several well-known implementations: ◦ JavaScript ◦ JScript ◦ ActionScript
History of ES • First edition 1997 • ES 3
in 1999 • ES 4 never released : too ambitious • ES 5 in 2009 • ES 6/2015 also called Harmony • ES 7/2016
ES2015 features
Promises var promise = new Promise(function(resolve, reject) { // some
code }); promise.then(successCb, errorCb); promise.catch(errorCb); Promise.all([promise1, promise2]);
Class class MyClass extends MyParentClass { constructor (param1, param2) {
super(param1, param2); // some code } myMethod1(param) { // some code } static myMethod2(param) { // some code } }
Generator function* testYield(){ var index = 0; while(index < 3){
yield index++; } } var gen = testYield(); console.log(gen.next().value); // 0 console.log(gen.next().value); // 1 console.log(gen.next().value); // 2 console.log(gen.next().value); // undefined
Let - Const function varTest() { var x = 31;
if (true) { var x = 71; console.log(x); // 71 } console.log(x); // 71 } function letTest() { let x = 31; if (true) { let x = 71; console.log(x); // 71 } console.log(x); // 31 } const myConstant = 42; myConstant = 12; // Error const myConstant = 3; // Error
Arrow ([param] [, param]) => { instructions } param =>
expression // implicit return var square = (x) => x*x;
Arrow - Bind this lexically ES5: var myObject = {
var myString = ‘Hello’; var myArray = [‘a’, ‘b’, ‘c’]; var myMethod = function () { var self = this; this.myArray.forEach(function(element){ console.log(self.myString + element); }) } } ES2015: var myObject = { var myString = ‘Hello’; var myArray = [‘a’, ‘b’, ‘c’]; var myMethod = function () { this.myArray.forEach((element) => console.log(this.myString + element); }) } }
Destructuring var anArray = [1,2,3]; var [one, two, three] =
anArray; var [foo, [[bar], baz]] = [1, [[2], 3]]; var anObject = {prop1: ‘abc’}; var {prop1: myProp1} = anObject;
String template console.log(`first line second line`); var a = 2;
var b = 3; console.log(`the sum of a and b is ${a+b}`);
For .. of var myArray = [‘a’, ‘b’, ’c’]; for(
let myElement of myArray) { console.log(myElement); }
Modules // lib.js export square = (x) => x*x; //
main.js import {square} from lib; console.log(square(4)); NB: a lot of variation of ‘import’ syntax exist to please both AMD and Common.js users
Map set let mySet = new Set([1,2,2,2,2,2,2]); mySet.add(3); console.log(mySet.size); //
3 console.log(mySet.has(2); // true mySet.delete(2); console.log(mySet.has(2); // false
Current support
ES 2015
ES 2016
Links • http://kangax.github.io/compat-table/es6/ • http://es6katas.org/ • https://babeljs.io/docs/learn-es2015/