SlideShare a Scribd company logo
Ignite es6
The Future of
JavaScript with ES6
Ignite es6
Banning the var statement
function loop (array) {
for (var index = 0; i < array.length; index++) {
/* do stuff */
}
console.log(index); // => STILL AVAILABLE???
}
Use let instead
function loop (array) {
for (let index = 0; i < array.length; index++) {
/* do stuff */
}
console.log(index); // Not anymore!!!
}
There’s also const
const x = 1;
x = 2; // not possible!
const obj = { x: 1 };
obj.x = 2; // possible!
Remember anonymous functions?
[1,2,3,4].map(function(n){ return n * n; });
Hello arrow functions!
[1,2,3,4].map((n) => n * n);
Also
default parameters are in town!
function (x, y = 2) { return x + y);
Consider this
Getting the rest
function addPlayersToTeam (team /*, players*/) {
var players = arguments.slice(1);
for (var i = 0; args.length; i++) {
team.addPlayer(args[i]);
}
}
Thank you rest parameter
function addPlayersToTeam (team, …rest) {
rest.forEach((player) => team.addPlayer(player));
}
Destructing your object
var {a, c} = {a: 1, b: 2, c: 3}
console.log(a); // logs 1
Destructing arrays
var foo = [“one”, “two”, “three" ]
var one = foo[0];
var [one, two] = foo;
Easier Recursive
function sum ([x, …rest]) {
if (x) return x + sum(rest);
else return 0;
}
console.log(sum([1,2,3]));
Fetch me some data!
fetch(‘/some/url’)
.then(function(response){
return response.json();
})
.then(function(json) {
// something with json
}).catch(function(err) {
// error :(
});
Fetch me some data!
fetch(‘/some/url’)
.then( (response) => response.json() )
.then( (json) => doStuff(json) )
.catch( (error) => handleError(error) );
Template my string
var a = 5;
var b = 10;
console.log(`Fifteen is ${a+b} and
not ${2*a + b}`);
Template my string
var user = { … };
var html = `
<div>
<span>${user.username}</span>
</div>
`
Enhanced Object Literals
var obj = {
__proto__: protoObj,
handler
}
Enhanced Object Literals
var obj = {
toString () { return super.toString(); },
[‘prop_’+key()]: key()
}
How to use ES6 NOW

More Related Content

PPTX
MiamiJS - The Future of JavaScript
PPT
Prgišče Lispa
PDF
bpftrace - Tracing Summit 2018
PDF
An Intro To ES6
PDF
LIFULL HOME‘S App Night #AR 最速対応をした間取り計測の秘話
PPTX
Luis Atencio on RxJS
PDF
Add Some Fun to Your Functional Programming With RXJS
PDF
The hidden and new parts of JS
MiamiJS - The Future of JavaScript
Prgišče Lispa
bpftrace - Tracing Summit 2018
An Intro To ES6
LIFULL HOME‘S App Night #AR 最速対応をした間取り計測の秘話
Luis Atencio on RxJS
Add Some Fun to Your Functional Programming With RXJS
The hidden and new parts of JS

What's hot (20)

PDF
Faster Python, FOSDEM
PDF
OCamlOScope: a New OCaml API Search
PDF
What they don't tell you about JavaScript
PDF
NS2: AWK and GNUplot - PArt III
ODP
2.3 implicits
PDF
Multi dimensional profiling
PDF
Ns2: OTCL - PArt II
PDF
Ns2: Introduction - Part I
PDF
ClojureScript - A functional Lisp for the browser
KEY
Parallel Computing in R
PPT
Cpp tutorial
PDF
rx.js make async programming simpler
PPT
Standard Template Library (STL) in Object Oriented Programming
PDF
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
PDF
R Data Analysis/Rを使った人事データ分析入門
PPT
Jan 2012 HUG: RHadoop
PPT
Python 101 language features and functional programming
PPTX
Lua: the world's most infuriating language
PDF
Real World Generics In Swift
PDF
D vs OWKN Language at LLnagoya
Faster Python, FOSDEM
OCamlOScope: a New OCaml API Search
What they don't tell you about JavaScript
NS2: AWK and GNUplot - PArt III
2.3 implicits
Multi dimensional profiling
Ns2: OTCL - PArt II
Ns2: Introduction - Part I
ClojureScript - A functional Lisp for the browser
Parallel Computing in R
Cpp tutorial
rx.js make async programming simpler
Standard Template Library (STL) in Object Oriented Programming
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
R Data Analysis/Rを使った人事データ分析入門
Jan 2012 HUG: RHadoop
Python 101 language features and functional programming
Lua: the world's most infuriating language
Real World Generics In Swift
D vs OWKN Language at LLnagoya
Ad

Viewers also liked (7)

PDF
PWC certificate
PDF
What Actually UI/UX Designer Do?
PDF
Esi ebroshure
PPTX
Русификатор mmorpg final fantasy 14
PDF
Capella Transcipt
PDF
Operation terre inconnue
PDF
Reading 3 - Lean Accounting - PDF
PWC certificate
What Actually UI/UX Designer Do?
Esi ebroshure
Русификатор mmorpg final fantasy 14
Capella Transcipt
Operation terre inconnue
Reading 3 - Lean Accounting - PDF
Ad

Similar to Ignite es6 (20)

PPTX
Es6 hackathon
PDF
Workshop 10: ECMAScript 6
PDF
Javascript
PDF
Explaining ES6: JavaScript History and What is to Come
PDF
ECMAScript 6 Review
ODP
EcmaScript 6
PDF
ES6: The future is now
PDF
Internal workshop es6_2015
PDF
EcmaScript 6 - The future is here
PDF
"Немного о функциональном программирование в JavaScript" Алексей Коваленко
PPTX
ES6 and AngularAMD
PDF
ECMAScript 6 and beyond
PDF
ESCMAScript 6: Get Ready For The Future. Now
PPTX
Call stack, event loop and async programming
PPTX
ES6 Overview
PDF
ECMAScript 6
PPTX
Javascript Basics
PPTX
EcmaScript unchained
PDF
"let ECMAScript = 6"
ODP
ES6 PPT FOR 2016
Es6 hackathon
Workshop 10: ECMAScript 6
Javascript
Explaining ES6: JavaScript History and What is to Come
ECMAScript 6 Review
EcmaScript 6
ES6: The future is now
Internal workshop es6_2015
EcmaScript 6 - The future is here
"Немного о функциональном программирование в JavaScript" Алексей Коваленко
ES6 and AngularAMD
ECMAScript 6 and beyond
ESCMAScript 6: Get Ready For The Future. Now
Call stack, event loop and async programming
ES6 Overview
ECMAScript 6
Javascript Basics
EcmaScript unchained
"let ECMAScript = 6"
ES6 PPT FOR 2016

More from jstack (9)

PPTX
Ignite content security policy
PPTX
Ignite docker
PPTX
Git branching strategies
PPT
Auto Merge Queue
PPTX
Ionic
PPTX
Gradle
PPTX
Flyway - database migrations made easy
PPTX
Domain driven design
PPTX
Software development terminology
Ignite content security policy
Ignite docker
Git branching strategies
Auto Merge Queue
Ionic
Gradle
Flyway - database migrations made easy
Domain driven design
Software development terminology

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Cloud computing and distributed systems.
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
KodekX | Application Modernization Development
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Electronic commerce courselecture one. Pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
cuic standard and advanced reporting.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
20250228 LYD VKU AI Blended-Learning.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Big Data Technologies - Introduction.pptx
Cloud computing and distributed systems.
NewMind AI Monthly Chronicles - July 2025
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
KodekX | Application Modernization Development
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The AUB Centre for AI in Media Proposal.docx
Electronic commerce courselecture one. Pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Dropbox Q2 2025 Financial Results & Investor Presentation
cuic standard and advanced reporting.pdf
Machine learning based COVID-19 study performance prediction
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Ignite es6