Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Whats New In EcmaScript 2015 / ES6
Search
Hans Kristian Flaatten
January 28, 2016
Technology
78
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Whats New In EcmaScript 2015 / ES6
Hans Kristian Flaatten
January 28, 2016
More Decks by Hans Kristian Flaatten
See All by Hans Kristian Flaatten
Continuous Deployment with Jenkins Pipelines
starefossen
0
62
Continuous Integrations with Jenkins
starefossen
0
72
Testing Node.js
starefossen
0
35
What is Node.js?
starefossen
0
47
LeftPad Not Found
starefossen
0
91
Experience with NoSQL at the Norwegian Trekking Asocciation
starefossen
0
55
Introduction to Geospatial Queries in MongoDB
starefossen
0
42
Åpen Tur- og Friluftsdata
starefossen
0
110
Reverse Engineering APIs from iOS and Android Apps
starefossen
0
71
Other Decks in Technology
See All in Technology
「重なり」は迎える側がつくる ― 人もAIエージェントも歓迎するプロダクトエンジニアリング ―
go0517go
PRO
0
280
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/6 - 2026/8
oracle4engineer
PRO
0
160
AI 駆動 Terraform 開発/SRE_BizReach_MIXI_2
visional_engineering_and_design
4
2.1k
Sigmaユーザーのための有用リソース一挙公開 & Sigmaで使えるMCP #sigma_ucj /useful-resources-for-sigma-computing-users-and-mcps-with-sigma
shinyaa31
0
190
Deploying a Full-Stack Bun-Native Framework on Cloudflare Workers
7nohe
0
140
深夜のクラウド懺悔室 1:29:300 or 1:0:0
kazzpapa3
1
230
幾何アルゴリズムで なめらかなピン操作を / iOSDC Japan 2026 / smoothpin
kazumanagano
0
270
Amazon S3 Tablesに全部任せてみた結果——コンパクション/スナップショット管理は本当に手放せるか
shigeruoda
1
480
Claude Code本って、 読む必要あるの?
oikon48
2
410
クロスボーダーM&AのValue Upを支えるプロダクト開発。日米チームのハブになったプロダクトエンジニアの実践 / Product Engineering Conference 2026
genda
0
120
AI時代に顧客へ最速で価値を 届けるための試行錯誤 〜「AI × マネジメント」領域におけるmentoのケース〜
posterkeisuke
0
110
2026_devsumi_ozono.pdf
o3
3
410
Featured
See All Featured
Side Projects
sachag
456
43k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Un-Boring Meetings
codingconduct
0
410
The Language of Interfaces
destraynor
162
27k
The browser strikes back
jonoalderson
0
1.7k
Designing Experiences People Love
moore
143
24k
Optimizing for Happiness
mojombo
378
71k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
240
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
420
Transcript
ECMAScript 6 Hans Kristian Flaatten 1 Bergen Linux User Group
Torsdag 28. januar 2016 Bergen Offentlige Bibliotek
ES6 Hans Kristian Flaatten 2 Bergen Linux User Group Torsdag
28. januar 2016 Bergen Offentlige Bibliotek
ECMAScript 2015 Hans Kristian Flaatten 3 Bergen Linux User Group
Torsdag 28. januar 2016 Bergen Offentlige Bibliotek
JavaScript ≠ ECMAScript 4
• arrows functions • classes • enhanced object literals •
template strings • destructuring • default + rest + spread • let + const • iterators + for..of • generators • unicode • modules • module loaders • map + set + weakmap + weakset • proxies • symbols • subclassable built-ins • promises • math + number + string + array + object APIs • binary and octal literals • reflect api • tail calls 5
Block Scopes 6 (function () { var food = 'Meow
Mix'; }()); console.log(food); // Reference Error
Block Scopes 7 { let food = 'Meow Mix'; }
console.log(food); // Reference Error
Arrow Functions 8 function Person(name) { this.name = name; }
Person.prototype.prefixName = function (arr) { return arr.map(function (character) { return this.name + character; // Cannot read property 'name' of undefined }); };
Arrow Functions 9 function Person(name) { this.name = name; }
Person.prototype.prefixName = function (arr) { var that = this; // Store the context of this return arr.map(function (character) { return that.name + character; }); };
Arrow Functions 10 function Person(name) { this.name = name; }
Person.prototype.prefixName = function (arr) { return arr.map(character => this.name + character); };
Arrow Functions 11 var arr = [1, 2, 3, 4,
5]; var squares = arr.map(function (x) { return x * x });
Arrow Functions 12 var arr = [1, 2, 3, 4,
5]; var squares = arr.map(x => x * x);
Template Strings 13 var name = 'Tiger'; var age =
10; console.log('My name is ' + name + ', I am ' + age + ' years');
Template Strings 14 let name = 'Tiger'; let age =
10; console.log(`My name is ${name} and I am ${age} years.`);
Multiline Template Strings 15 var text = ( 'cat\n' +
'dog\n' + 'nickelodeon' );
Multiline Template Strings 16 var text = [ 'cat', 'dog',
'nickelodeon' ].join('\n');
Multiline Template Strings 17 let text = `cat dog nickelodeon`;
Destructing Arrays 18 var arr = [1, 2, 3, 4];
var a = arr[0]; var b = arr[1]; var c = arr[2]; var d = arr[3];
Destructing Arrays 19 let [a, b, c, d] = [1,
2, 3, 4]; console.log(a); // 1 console.log(b); // 2
Destructing Arrays 20 var luke = { occupation: 'jedi', father:
'anakin' }; var occupation = luke.occupation; // 'jedi' var father = luke.father; // 'anakin'
Destructing Arrays 21 let luke = { occupation: 'jedi', father:
'anakin' }; let {occupation, father} = luke; console.log(occupation); // 'jedi' console.log(father); // 'anakin'
Default Function Parameters 22 function addTwoNumbers(x, y) { x =
x || 0; y = y || 0; return x + y; }
Default Function Parameters 23 function addTwoNumbers(x=0, y=0) { return x
+ y; } addTwoNumbers(2, 4); // 6 addTwoNumbers(2); // 2 addTwoNumbers(); // 0
Named Function Parameters 24 function drawES5Chart(options) { options = options
=== undefined ? {} : options; var size = options.size === undefined ? 'big' : options.size; var cords = options.cords === undefined ? { x: 0, y: 0 } : options.cords; var radius = options.radius === undefined ? 25 : options.radius; console.log(size, cords, radius); // now finally do some chart drawing } drawES5Chart({ cords: { x: 18, y: 30 }, radius: 30 });
Named Function Parameters 25 function drawES6Chart({ size: size = 'big',
cords: cords = { x: 0, y: 0 }, radius: radius = 25 } = {}) { console.log(size, cords, radius); // do some chart drawing } drawES6Chart({ cords: { x: 18, y: 30 }, radius: 30 }); // 'big' {x: 18, y: 30} 30
Generators 26 function* fibonacci(){ let val1 = 0, val2 =
1, swap; yield val1; yield val2; while (true){ swap = val1 + val2; val1 = val2; val2 = swap; yield swap; } }
Generators 27 var sequence = fibonacci(); sequence.next().value // 0 sequence.next().value
// 1 sequence.next().value // 1 sequence.next().value // 2 sequence.next().value // 3 sequence.next().value // 5 sequence.next().value // 8
Browser Support 28 Browser ECMAScript 6 Support Google Chrome 91
% Edge 83 % FireFox 85 % Safari 54 % Kilde: https://kangax.github.io/compat-table/es6/
Node.js ES6 Support 29 0 25 50 75 100 v0.10
(3.14) v0.12 (v8 3.28) v4 (v8 4.5) v5 (v8 4.6) v6 (v8 5.0)
30
ECMAScript 7 ?! 31
ECMAScript 7 32
ECMAScript 2016 33