SlideShare a Scribd company logo
1 of 117
Download to read offline
ECMAScript 2015
Huge
1.What have changed
2. New features
Agenda
What have
changed.
var
IIFE
function(){}
param=param||"default"
‘Hello’+myVar+‘.'
callbackhell
let
{blocks}
()=>
function(param="default")
`Hello${myVar}.`
promises
ES2015.ES5.
What have changed.
What have changed.

1. Let.
2. Blocks.
3. Arrow functions.
4. Default params.
5. String interpolation.
6. Promises.
Let.
Whathavechanged.
Name.
Let.
In computer science,a“let” expression
associates a function definition with a
restricted scope.
The“let” expression may also be
defined in mathematics,where it
associates a Boolean condition with a
restricted scope.
Scope.
Let.
The“let” statement declares a block
scope local variable.
“Let” allows you to declare variables that are limited in scope
to the block, statement, or expression on which it is used.

“Var” variables are limited in scope to the function statement.
Use ”let” to define variables
limited in scope to the block.
“Var” isn’t dead.
"Let" will make the javascript engine create a new scope for
each block that has a "let" variable in it.
Examples.
Let.
Temporal dead zone.
Let.
Live code
example.
Blocks.
Whathavechanged.
History.
Blocks.
Ideas of block structure were developed
in the 1950s during the development of
the first autocodes,and were formalized
in the Algol 58 and Algol 60 reports.
In computer programming,a block or
code block is a section of code which is
grouped together.Blocks consist of one
or more declarations and statements.
Blocks narrow the lexical scope of
variables,procedures and functions
declared in it,so that they do not conflict
with variables having the same name
used elsewhere.
Other languages.
Blocks.
Algol
Python
Examples.
Blocks.
Arrow functions.
Whathavechanged.
About.
Arrowfunctions.
Arrow functions are always anonymous.
An arrow function expression has a shorter syntax compared to
function expressions and lexically binds the "this" value.
Examples.
Arrowfunctions.
Lexical "this".
Shorter functions.
Default params.
Whathavechanged.
String interpolation.
Whathavechanged.
Promises.
Whathavechanged.
About.
Promises.
The Promise object is used for deferred
and asynchronous computations.
A Promise represents an operation that
hasn't completed yet, but is expected
in the future.
The cure.
Example.
Promises.
Promise chain.
Gates of hell.
New
Const.
New.
In computer programming,a constant is
an identifier with an associated value
which cannot be altered.
The const declaration creates
a read-only reference to a value.
It does not mean the value
it holds is immutable.
Constants are block-scoped.
A constant cannot share its name
with a function or a variable
in the same scope.
Useful methods.
New.
Array Find.
Usefulmethods.
The“find” method returns
a single value in the array.
And the“filter” method?

What is the difference?
Object Assign.
Usefulmethods.
The "assign" method is used to copy all
enumerable own properties from one or
more source objects to a target object.
Cloning an object.
Merging objects.
Does he copy the methods too?
Spread / Rest.
New.
Symbol.
New.
A symbol is a unique
and immutable data type.
Symbols are the same even 

when in other threads.
Symbol properties.
Iterator & Iterable.
New.
The iterator protocol defines a
standard way to produce
a sequence of values.
The Iterable protocol allows JavaScript
objects to define or customize their
iteration behavior.
This is an iterator.
This is an iterable.
Can I create a custom iterator?
Generator.
New.
Generators are functions which can be
exited and later re-entered.
The “function*” declaration defines a
generator function.
A generator returns an iterator.
Run .. Stop .. Run
Questions?
What is new on ES6

More Related Content

What's hot

What's hot (20)

Computer and Network Technology (CNT) - Lecture 04
Computer and Network Technology (CNT) - Lecture 04Computer and Network Technology (CNT) - Lecture 04
Computer and Network Technology (CNT) - Lecture 04
 
Restful webservices for android
Restful webservices for android Restful webservices for android
Restful webservices for android
 
5 2 Notes
5 2 Notes5 2 Notes
5 2 Notes
 
packaging procedures_and_state
packaging procedures_and_statepackaging procedures_and_state
packaging procedures_and_state
 
Code rule
Code ruleCode rule
Code rule
 
First order partial differential equations
First order partial differential equationsFirst order partial differential equations
First order partial differential equations
 
Formation of partial differential equations by eliminating arbitrary functions
Formation of partial differential equations by eliminating arbitrary functionsFormation of partial differential equations by eliminating arbitrary functions
Formation of partial differential equations by eliminating arbitrary functions
 
Hunting Bugs While Sleeping: Property-Based Testing with Continuous Integration
Hunting Bugs While Sleeping: Property-Based Testing with Continuous IntegrationHunting Bugs While Sleeping: Property-Based Testing with Continuous Integration
Hunting Bugs While Sleeping: Property-Based Testing with Continuous Integration
 
Criterion of functional fullness in many-valued logic
Criterion of functional fullness in many-valued logicCriterion of functional fullness in many-valued logic
Criterion of functional fullness in many-valued logic
 
Java DataBase Connectivity - JDBC Part-2
Java DataBase Connectivity - JDBC Part-2Java DataBase Connectivity - JDBC Part-2
Java DataBase Connectivity - JDBC Part-2
 
Array and functions
Array and functionsArray and functions
Array and functions
 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
 
E2D3 ver. 0.2 API Instruction
E2D3 ver. 0.2 API InstructionE2D3 ver. 0.2 API Instruction
E2D3 ver. 0.2 API Instruction
 
The task is to convert a given integer grade (0..100) into a corresponding le...
The task is to convert a given integer grade (0..100) into a corresponding le...The task is to convert a given integer grade (0..100) into a corresponding le...
The task is to convert a given integer grade (0..100) into a corresponding le...
 
7. Rest parameters | ES6 | JavaScript
7. Rest parameters | ES6 | JavaScript7. Rest parameters | ES6 | JavaScript
7. Rest parameters | ES6 | JavaScript
 
Functional forms in regression
Functional forms in regressionFunctional forms in regression
Functional forms in regression
 
8. Spread Syntax | ES6 | JavaScript
8. Spread Syntax | ES6 | JavaScript8. Spread Syntax | ES6 | JavaScript
8. Spread Syntax | ES6 | JavaScript
 
PeopleCode Variable Scope Quiz
PeopleCode Variable Scope QuizPeopleCode Variable Scope Quiz
PeopleCode Variable Scope Quiz
 
A Reflective Approach to Actor-Based Concurrent Context-Oriented Systems
A Reflective Approach to Actor-Based Concurrent Context-Oriented SystemsA Reflective Approach to Actor-Based Concurrent Context-Oriented Systems
A Reflective Approach to Actor-Based Concurrent Context-Oriented Systems
 
What Do You Mean By NUnit
What Do You Mean By NUnitWhat Do You Mean By NUnit
What Do You Mean By NUnit
 

Viewers also liked

Intro to the LA Design Community
Intro to the LA Design CommunityIntro to the LA Design Community
Intro to the LA Design Community
Huge
 
DataWeek: Oh no, I'm running a data-driven cult!
DataWeek: Oh no, I'm running a data-driven cult!DataWeek: Oh no, I'm running a data-driven cult!
DataWeek: Oh no, I'm running a data-driven cult!
Huge
 
Intro to the LA Design Community Resources
Intro to the LA Design Community ResourcesIntro to the LA Design Community Resources
Intro to the LA Design Community Resources
Huge
 

Viewers also liked (20)

Social e conteúdo preditivo: como antever reações de usuários e diminuir risc...
Social e conteúdo preditivo: como antever reações de usuários e diminuir risc...Social e conteúdo preditivo: como antever reações de usuários e diminuir risc...
Social e conteúdo preditivo: como antever reações de usuários e diminuir risc...
 
Desenvolvimento Client-Side 2016
Desenvolvimento Client-Side 2016Desenvolvimento Client-Side 2016
Desenvolvimento Client-Side 2016
 
A importância da UX para o consumo de conteúdo digital
A importância da UX para o consumo de conteúdo digitalA importância da UX para o consumo de conteúdo digital
A importância da UX para o consumo de conteúdo digital
 
Desenvolvimento Orientado a Qualidade
Desenvolvimento Orientado a QualidadeDesenvolvimento Orientado a Qualidade
Desenvolvimento Orientado a Qualidade
 
Desenvolvimento Client-Side 2016 (BrazilJS)
Desenvolvimento Client-Side 2016 (BrazilJS)Desenvolvimento Client-Side 2016 (BrazilJS)
Desenvolvimento Client-Side 2016 (BrazilJS)
 
Javascript State of the Union 2015
Javascript State of the Union 2015Javascript State of the Union 2015
Javascript State of the Union 2015
 
All You Need Is TDD (Português)
All You Need Is TDD (Português)All You Need Is TDD (Português)
All You Need Is TDD (Português)
 
How Corporate Personhood Might Just Save the World
How Corporate Personhood Might Just Save the WorldHow Corporate Personhood Might Just Save the World
How Corporate Personhood Might Just Save the World
 
Client-side Development 2016
Client-side Development 2016Client-side Development 2016
Client-side Development 2016
 
Javascript State of the Union 2015 - English
Javascript State of the Union 2015 - EnglishJavascript State of the Union 2015 - English
Javascript State of the Union 2015 - English
 
RobotUX: A Framework for Human-Robot Interactions
RobotUX: A Framework for Human-Robot InteractionsRobotUX: A Framework for Human-Robot Interactions
RobotUX: A Framework for Human-Robot Interactions
 
Intro to the SF Design Community Resources
Intro to the SF Design Community ResourcesIntro to the SF Design Community Resources
Intro to the SF Design Community Resources
 
The Augmented Future: Entertainment & Utility
The Augmented Future: Entertainment & UtilityThe Augmented Future: Entertainment & Utility
The Augmented Future: Entertainment & Utility
 
Intro to the LA Design Community Resources
Intro to the LA Design Community ResourcesIntro to the LA Design Community Resources
Intro to the LA Design Community Resources
 
Intro to the LA Design Community
Intro to the LA Design CommunityIntro to the LA Design Community
Intro to the LA Design Community
 
DataWeek: Oh no, I'm running a data-driven cult!
DataWeek: Oh no, I'm running a data-driven cult!DataWeek: Oh no, I'm running a data-driven cult!
DataWeek: Oh no, I'm running a data-driven cult!
 
Intro to the LA Design Community Resources
Intro to the LA Design Community ResourcesIntro to the LA Design Community Resources
Intro to the LA Design Community Resources
 
What is Digital Life Worth?
What is Digital Life Worth?What is Digital Life Worth?
What is Digital Life Worth?
 
The New Creative Partners: Brand Planning Meets UX
The New Creative Partners: Brand Planning Meets UXThe New Creative Partners: Brand Planning Meets UX
The New Creative Partners: Brand Planning Meets UX
 
Forget channels: Context is King (IA Summit)
Forget channels: Context is King (IA Summit)Forget channels: Context is King (IA Summit)
Forget channels: Context is King (IA Summit)
 

Similar to What is new on ES6

Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoft
ch samaram
 
CS5393-Korat_Mittal_Akshay_ProjReport
CS5393-Korat_Mittal_Akshay_ProjReportCS5393-Korat_Mittal_Akshay_ProjReport
CS5393-Korat_Mittal_Akshay_ProjReport
Akshay Mittal
 
RubyMiniGuide-v1.0_0
RubyMiniGuide-v1.0_0RubyMiniGuide-v1.0_0
RubyMiniGuide-v1.0_0
tutorialsruby
 
RubyMiniGuide-v1.0_0
RubyMiniGuide-v1.0_0RubyMiniGuide-v1.0_0
RubyMiniGuide-v1.0_0
tutorialsruby
 
Introduction to Drools
Introduction to DroolsIntroduction to Drools
Introduction to Drools
giurca
 

Similar to What is new on ES6 (20)

Es6 day1
Es6 day1Es6 day1
Es6 day1
 
Intro to Scala
 Intro to Scala Intro to Scala
Intro to Scala
 
Java script function
Java script functionJava script function
Java script function
 
VB.net
VB.netVB.net
VB.net
 
Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoft
 
CS5393-Korat_Mittal_Akshay_ProjReport
CS5393-Korat_Mittal_Akshay_ProjReportCS5393-Korat_Mittal_Akshay_ProjReport
CS5393-Korat_Mittal_Akshay_ProjReport
 
JavaScript.pptx
JavaScript.pptxJavaScript.pptx
JavaScript.pptx
 
1669958779195.pdf
1669958779195.pdf1669958779195.pdf
1669958779195.pdf
 
Advance oops concepts
Advance oops conceptsAdvance oops concepts
Advance oops concepts
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
Java Script Introduction
Java Script IntroductionJava Script Introduction
Java Script Introduction
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
 
C# interview
C# interviewC# interview
C# interview
 
Functions in Python Syntax and working .
Functions in Python Syntax and working .Functions in Python Syntax and working .
Functions in Python Syntax and working .
 
Introduction to es6
Introduction to es6Introduction to es6
Introduction to es6
 
The Uniform Access Principle
The Uniform Access PrincipleThe Uniform Access Principle
The Uniform Access Principle
 
Javascript functions
Javascript functionsJavascript functions
Javascript functions
 
RubyMiniGuide-v1.0_0
RubyMiniGuide-v1.0_0RubyMiniGuide-v1.0_0
RubyMiniGuide-v1.0_0
 
RubyMiniGuide-v1.0_0
RubyMiniGuide-v1.0_0RubyMiniGuide-v1.0_0
RubyMiniGuide-v1.0_0
 
Introduction to Drools
Introduction to DroolsIntroduction to Drools
Introduction to Drools
 

More from Huge

Humans: The Next Interface
Humans: The Next InterfaceHumans: The Next Interface
Humans: The Next Interface
Huge
 
Smart Cities: How Smart is Too Smart?
Smart Cities: How Smart is Too Smart?Smart Cities: How Smart is Too Smart?
Smart Cities: How Smart is Too Smart?
Huge
 
UX Portfolio Tips
UX Portfolio TipsUX Portfolio Tips
UX Portfolio Tips
Huge
 
The Pitfalls of Process
The Pitfalls of ProcessThe Pitfalls of Process
The Pitfalls of Process
Huge
 

More from Huge (11)

With Users Like These Who Needs Enemies?
With Users Like These Who Needs Enemies?With Users Like These Who Needs Enemies?
With Users Like These Who Needs Enemies?
 
The Practitioner's Guide to Digital Transformation
The Practitioner's Guide to Digital TransformationThe Practitioner's Guide to Digital Transformation
The Practitioner's Guide to Digital Transformation
 
What Digital Orgs Can Learn from Software Design
What Digital Orgs Can Learn from Software DesignWhat Digital Orgs Can Learn from Software Design
What Digital Orgs Can Learn from Software Design
 
Humans: The Next Interface
Humans: The Next InterfaceHumans: The Next Interface
Humans: The Next Interface
 
What Matters Now: Education
What Matters Now: EducationWhat Matters Now: Education
What Matters Now: Education
 
Brands as Publishers.
Brands as Publishers.Brands as Publishers.
Brands as Publishers.
 
Smart Cities: How Smart is Too Smart?
Smart Cities: How Smart is Too Smart?Smart Cities: How Smart is Too Smart?
Smart Cities: How Smart is Too Smart?
 
What Matters Now: Retail
What Matters Now: RetailWhat Matters Now: Retail
What Matters Now: Retail
 
Future-Proofing the Web: Choosing the Optimal Mobile Design Strategy
Future-Proofing the Web: Choosing the Optimal Mobile Design StrategyFuture-Proofing the Web: Choosing the Optimal Mobile Design Strategy
Future-Proofing the Web: Choosing the Optimal Mobile Design Strategy
 
UX Portfolio Tips
UX Portfolio TipsUX Portfolio Tips
UX Portfolio Tips
 
The Pitfalls of Process
The Pitfalls of ProcessThe Pitfalls of Process
The Pitfalls of Process
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

What is new on ES6