SlideShare a Scribd company logo
Introduction of ES2015
Shigeru Nakajima a.k.a ledsun
2016/4/28 Machida Tech Night #3
Who am I
• JavaScript on browser
• C# WPF
• 37 years old
What is ES2015
• New syntaxes and libraries of
JavaScript.
• Update yearly.
ES2016, ES2017...
• Big changes from the ECMA-262 5.1
Edition @ 2011.
Supported by almost modern
browsers.
• CH50 93%, Node6 93%, FF46 90%,
Edge13 79%, SF 53%
• https://kangax.github.io/compat-
table/es6/
We can use now
• class
• object literal extensions
• template literals
• Map/Set, WeakMap/WeakSet
• destructuring
Before class
function Person(name, age, gender) {
this.name = name;
this.age = age;
this.gender = gender;
}
Person.prototype.incrementAge = function () {
this.age += 1;
};
After class
class Person {
constructor(name, age, gender) {
this.name = name;
this.age = age;
this.gender = gender;
}
incrementAge() {
this.age += 1;
}
}
Before object literal
extensions
var obj = {
handler: handler,
toString: function() {
return "d ";
},
prop_42: 42
};
After object literal
extensions
var obj = {
handler,
toString() {
return "d ";
},
// Computed (dynamic) property names
[ 'prop_' + (() => 42)() ]: 42
};
class
Before template literal
var text = (
'catn' +
'dogn' +
'nickelodeon'
);
var text2 = 'My cat is named ' + name + '.';
After template literal
var text = `cat
dog
nickelodeon`;
var text2 = `My cat is named ${name}.`;
template literal to HTML
var div = `
<div class="hoge">
Hello world!
</div>
`
document.body.innerHTML(div)
Before Map
var map = {};
map.name = 'john';
map.name; // john
After Map
var map = new Map([
['name', 'david'],
[true, 'false'],
[1, 'one'],
[{}, 'object'],
[function () {}, 'function']
]);
map.has('name');
map.set('name', 'john');
map.get('name'); // john
Before destructuring
var arr = [1, 2, 3, 4];
var a = arr[0];
var b = arr[1];
var c = arr[2];
var d = arr[3];
var luke = { occupation: 'jedi', father: 'anakin' };
var occupation = luke.occupation; // 'jedi'
var father = luke.father; // 'anakin'
After destructuring
var [a, b, c, d] = [1, 2, 3, 4];
var luke = { occupation: 'jedi', father: 'anakin' };
var {occupation, father} = luke;
And More
• spread (...) operator
arr1.push(...arr2)
• for of loop
• Promise
• Symbol
• Object.assign
Reference
• Exploring ES6: Upgrade to the next
version of JavaScript
• DrkSephy/es6-cheatsheet: ES2015
[ES6] cheatsheet containing tips,
tricks, best practices and code
snippets
• lukehoban/es6features: Overview of
ECMAScript 6 features
Thank you!

More Related Content

What's hot (20)

PDF
ES6 - Level up your JavaScript Skills
Stefano Ceschi Berrini
 
PDF
Writing Clean Code in Swift
Derek Lee
 
PPTX
Introduction to Ecmascript - ES6
Nilesh Jayanandana
 
PDF
JavaScript Design Patterns
Derek Brown
 
PDF
Minimizing Decision Fatigue to Improve Team Productivity
Derek Lee
 
PDF
Functional programming using underscorejs
偉格 高
 
PDF
Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰
Jung Kim
 
PDF
Effective ES6
Teppei Sato
 
PDF
this
偉格 高
 
PDF
node ffi
偉格 高
 
PDF
JavaScript - Agora nervoso
Luis Vendrame
 
PDF
Javascript essential-pattern
偉格 高
 
PDF
All I know about rsc.io/c2go
Moriyoshi Koizumi
 
PDF
Javascript & Ajax Basics
Richard Paul
 
PPTX
Introduzione a C#
Lorenz Cuno Klopfenstein
 
PPTX
Async Frontiers
Domenic Denicola
 
PPT
C++ tutorial
sikkim manipal university
 
PDF
2016 gunma.web games-and-asm.js
Noritada Shimizu
 
PDF
스위프트를 여행하는 히치하이커를 위한 스타일 안내
Jung Kim
 
PDF
Clojutre Real Life (2012 ClojuTRE Retro Edition)
Metosin Oy
 
ES6 - Level up your JavaScript Skills
Stefano Ceschi Berrini
 
Writing Clean Code in Swift
Derek Lee
 
Introduction to Ecmascript - ES6
Nilesh Jayanandana
 
JavaScript Design Patterns
Derek Brown
 
Minimizing Decision Fatigue to Improve Team Productivity
Derek Lee
 
Functional programming using underscorejs
偉格 高
 
Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰
Jung Kim
 
Effective ES6
Teppei Sato
 
node ffi
偉格 高
 
JavaScript - Agora nervoso
Luis Vendrame
 
Javascript essential-pattern
偉格 高
 
All I know about rsc.io/c2go
Moriyoshi Koizumi
 
Javascript & Ajax Basics
Richard Paul
 
Introduzione a C#
Lorenz Cuno Klopfenstein
 
Async Frontiers
Domenic Denicola
 
2016 gunma.web games-and-asm.js
Noritada Shimizu
 
스위프트를 여행하는 히치하이커를 위한 스타일 안내
Jung Kim
 
Clojutre Real Life (2012 ClojuTRE Retro Edition)
Metosin Oy
 

Similar to Introduction of ES2015 (20)

PDF
Essentials and Impactful Features of ES6
Riza Fahmi
 
PDF
Es.next
Ignacio Gil
 
PPTX
ES6: Features + Rails
Santosh Wadghule
 
PPTX
Ecmascript 6
Gatuk S. Chattanon
 
PDF
ECMAScript 6 and beyond
Francis Johny
 
PDF
ECMAScript 6 Review
Sperasoft
 
PDF
Workshop 10: ECMAScript 6
Visual Engineering
 
PPTX
Introduction to es6
NexThoughts Technologies
 
PDF
Es6 to es5
Shakhzod Tojiyev
 
PDF
Introduction to ECMAScript 2015
Tomasz Dziuda
 
PPTX
ES6 and BEYOND
Brian Patterson
 
PDF
Internal workshop es6_2015
Miguel Ruiz Rodriguez
 
PDF
ES6 General Introduction
Thomas Johnston
 
PPTX
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
ES6: The future is now
Sebastiano Armeli
 
PDF
Idiomatic Javascript (ES5 to ES2015+)
David Atchley
 
PDF
ECMAScript 6 new features
GephenSG
 
PDF
ESCMAScript 6: Get Ready For The Future. Now
Krzysztof Szafranek
 
PDF
MCS First Year JavaScript ES6 Features.pdf
KavitaSawant18
 
PDF
Impress Your Friends with EcmaScript 2015
Lukas Ruebbelke
 
Essentials and Impactful Features of ES6
Riza Fahmi
 
Es.next
Ignacio Gil
 
ES6: Features + Rails
Santosh Wadghule
 
Ecmascript 6
Gatuk S. Chattanon
 
ECMAScript 6 and beyond
Francis Johny
 
ECMAScript 6 Review
Sperasoft
 
Workshop 10: ECMAScript 6
Visual Engineering
 
Introduction to es6
NexThoughts Technologies
 
Es6 to es5
Shakhzod Tojiyev
 
Introduction to ECMAScript 2015
Tomasz Dziuda
 
ES6 and BEYOND
Brian Patterson
 
Internal workshop es6_2015
Miguel Ruiz Rodriguez
 
ES6 General Introduction
Thomas Johnston
 
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
ES6: The future is now
Sebastiano Armeli
 
Idiomatic Javascript (ES5 to ES2015+)
David Atchley
 
ECMAScript 6 new features
GephenSG
 
ESCMAScript 6: Get Ready For The Future. Now
Krzysztof Szafranek
 
MCS First Year JavaScript ES6 Features.pdf
KavitaSawant18
 
Impress Your Friends with EcmaScript 2015
Lukas Ruebbelke
 
Ad

More from Nakajima Shigeru (6)

PDF
ChakraCore is what?
Nakajima Shigeru
 
PDF
20151117 es lint
Nakajima Shigeru
 
PDF
東京Node学園祭飛び込みLT
Nakajima Shigeru
 
PDF
Why js
Nakajima Shigeru
 
PDF
Ninja Testing at Toteka03
Nakajima Shigeru
 
PDF
Ninja Testing at XP Matsuri
Nakajima Shigeru
 
ChakraCore is what?
Nakajima Shigeru
 
20151117 es lint
Nakajima Shigeru
 
東京Node学園祭飛び込みLT
Nakajima Shigeru
 
Ninja Testing at Toteka03
Nakajima Shigeru
 
Ninja Testing at XP Matsuri
Nakajima Shigeru
 
Ad

Recently uploaded (20)

PPTX
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
PPTX
Distribution reservoir and service storage pptx
dhanashree78
 
PPTX
UNIT 1 - INTRODUCTION TO AI and AI tools and basic concept
gokuld13012005
 
PPTX
OCS353 DATA SCIENCE FUNDAMENTALS- Unit 1 Introduction to Data Science
A R SIVANESH M.E., (Ph.D)
 
PPT
Testing and final inspection of a solar PV system
MuhammadSanni2
 
PDF
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PPTX
Alan Turing - life and importance for all of us now
Pedro Concejero
 
PPTX
MODULE 05 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PDF
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
PPT
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
PDF
3rd International Conference on Machine Learning and IoT (MLIoT 2025)
ClaraZara1
 
PPTX
原版一样(EC Lille毕业证书)法国里尔中央理工学院毕业证补办
Taqyea
 
PDF
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
PPTX
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
PDF
Digital water marking system project report
Kamal Acharya
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PDF
WD2(I)-RFQ-GW-1415_ Shifting and Filling of Sand in the Pond at the WD5 Area_...
ShahadathHossain23
 
PPTX
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
Distribution reservoir and service storage pptx
dhanashree78
 
UNIT 1 - INTRODUCTION TO AI and AI tools and basic concept
gokuld13012005
 
OCS353 DATA SCIENCE FUNDAMENTALS- Unit 1 Introduction to Data Science
A R SIVANESH M.E., (Ph.D)
 
Testing and final inspection of a solar PV system
MuhammadSanni2
 
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
Alan Turing - life and importance for all of us now
Pedro Concejero
 
MODULE 05 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
3rd International Conference on Machine Learning and IoT (MLIoT 2025)
ClaraZara1
 
原版一样(EC Lille毕业证书)法国里尔中央理工学院毕业证补办
Taqyea
 
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
Digital water marking system project report
Kamal Acharya
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
WD2(I)-RFQ-GW-1415_ Shifting and Filling of Sand in the Pond at the WD5 Area_...
ShahadathHossain23
 
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 

Introduction of ES2015

  • 1. Introduction of ES2015 Shigeru Nakajima a.k.a ledsun 2016/4/28 Machida Tech Night #3
  • 2. Who am I • JavaScript on browser • C# WPF • 37 years old
  • 3. What is ES2015 • New syntaxes and libraries of JavaScript. • Update yearly. ES2016, ES2017... • Big changes from the ECMA-262 5.1 Edition @ 2011.
  • 4. Supported by almost modern browsers. • CH50 93%, Node6 93%, FF46 90%, Edge13 79%, SF 53% • https://kangax.github.io/compat- table/es6/
  • 5. We can use now • class • object literal extensions • template literals • Map/Set, WeakMap/WeakSet • destructuring
  • 6. Before class function Person(name, age, gender) { this.name = name; this.age = age; this.gender = gender; } Person.prototype.incrementAge = function () { this.age += 1; };
  • 7. After class class Person { constructor(name, age, gender) { this.name = name; this.age = age; this.gender = gender; } incrementAge() { this.age += 1; } }
  • 8. Before object literal extensions var obj = { handler: handler, toString: function() { return "d "; }, prop_42: 42 };
  • 9. After object literal extensions var obj = { handler, toString() { return "d "; }, // Computed (dynamic) property names [ 'prop_' + (() => 42)() ]: 42 }; class
  • 10. Before template literal var text = ( 'catn' + 'dogn' + 'nickelodeon' ); var text2 = 'My cat is named ' + name + '.';
  • 11. After template literal var text = `cat dog nickelodeon`; var text2 = `My cat is named ${name}.`;
  • 12. template literal to HTML var div = ` <div class="hoge"> Hello world! </div> ` document.body.innerHTML(div)
  • 13. Before Map var map = {}; map.name = 'john'; map.name; // john
  • 14. After Map var map = new Map([ ['name', 'david'], [true, 'false'], [1, 'one'], [{}, 'object'], [function () {}, 'function'] ]); map.has('name'); map.set('name', 'john'); map.get('name'); // john
  • 15. Before destructuring var arr = [1, 2, 3, 4]; var a = arr[0]; var b = arr[1]; var c = arr[2]; var d = arr[3]; var luke = { occupation: 'jedi', father: 'anakin' }; var occupation = luke.occupation; // 'jedi' var father = luke.father; // 'anakin'
  • 16. After destructuring var [a, b, c, d] = [1, 2, 3, 4]; var luke = { occupation: 'jedi', father: 'anakin' }; var {occupation, father} = luke;
  • 17. And More • spread (...) operator arr1.push(...arr2) • for of loop • Promise • Symbol • Object.assign
  • 18. Reference • Exploring ES6: Upgrade to the next version of JavaScript • DrkSephy/es6-cheatsheet: ES2015 [ES6] cheatsheet containing tips, tricks, best practices and code snippets • lukehoban/es6features: Overview of ECMAScript 6 features