SlideShare a Scribd company logo
NEXT GENERATION OF JAVASCRIPT
PREMKUMAR M,
Software Engineer,
1
Agenda
● Data Types
● Spread & Rest Operator
● Destructuring
● Classes
● Imports & Exports
● Arrow Functions
2
Data Types
3
Spread & Rest
Triple Dot (...)
4
Spread
5
The spread operator “spreads” the values in an iterable (arrays, strings) across
zero or more arguments or elements.
Rest
6
The rest parameter gives us an easier and cleaner way of working with an
indefinite number of parameters.
Destructuring
● Destructuring is a JavaScript expression that makes it possible to unpack values from
arrays, or properties from objects, into distinct variables.
● That is, we can extract data from arrays and objects and assign them to variables.
● Types of Destructuring
○ Array Destructuring
○ Object Destructuring
7
Array Destructuring - Examples
● const [ name1, name2 ] = [ ‘John’, ‘Peter’, ‘Jack’ ]
● const [ name1, ,name2 ] = [ ‘John’, ‘Peter’, ‘Jack’ ]
● const [ name1, ...names ] = [ ‘John’, ‘Peter’, ‘Jack’ ]
● const [ name1, , , name4= ’Mickel’ ] = [ ‘John’, ‘Peter’, ‘Jack’ ]
● const newArray = [...nameArray, ‘Mike’]
8
Swapping the values
const var1 =1
const var2 = 2
[ var2, var1 ] = [ var1, var2]
Object Destructuring - Examples
const employee = { name: ‘John’, ‘Age’: 23, Country: [ ‘Sydney’, ’London’ ]}
● const { name, Age = 18 } = employee
● const { Age: empAge } = employee
● const { Country: [country1]} = employee
● const {name, ...otherDetails} = employee
● const newObj = { ...employee }
9
const prop = ‘name’
const {[prop]: firstName} = employee
Classes
● Less code setup — Who doesn’t want to write less code? With ES6 classes the code to
write a function is much lesser compared to the traditional method.
● Constructor function — it provides a clear function to create objects.
● All the logic is contained — You can clearly specify the methods and properties in one
place instead of creating one constructor function and defining methods on the
prototype one-by-one.
10
Imports & Exports
There are 4 types of exports:
1— Named exports (several per module)
2— Default exports (one per module)
3— Mixed named & default exports
4— Cyclic Dependencies
11
MORE
Arrow Functions / Fat Arrow Functions
12
Arrow functions are a more concise syntax for writing function expressions. Arrow
Functions have two main benefits:
● A shorter syntax then typical functions
● No binding of this
No Binding of this
function Counter() {
this.num = 0;
this.timer = setInterval(function
add() {
this.num++;
console.log(this.num);
}, 1000);
}
var a = new Counter();
13
function Counter() {
this.num = 0;
this.timer = setInterval(() => {
this.num++;
console.log(this.num);
}, 1000);
}
var a = new Counter();
14
15

More Related Content

PPTX
constructors in java ppt
PPTX
C++Constructors
PPTX
Constructor and Destructor in c++
PPT
Constructor & Destructor
PPTX
Constructor ppt
PDF
Constructors and Destructors
PPTX
Constructor and Types of Constructors
constructors in java ppt
C++Constructors
Constructor and Destructor in c++
Constructor & Destructor
Constructor ppt
Constructors and Destructors
Constructor and Types of Constructors

What's hot (20)

PPTX
Constructor overloading & method overloading
PPTX
C++ Constructor destructor
PPT
Oop lec 5-(class objects, constructor & destructor)
PPTX
constructor and destructor
PPT
Constructor and Destructor PPT
PDF
Constructor and Destructor
PPTX
Constructor and destructor
PPTX
constructor with default arguments and dynamic initialization of objects
PPTX
Constructor & destructor
PPTX
Constructors and Destructors
PPTX
Constructor and Destructors in C++
PPTX
Constructor and desturctor
PPTX
Lecture 4.2 c++(comlete reference book)
PPSX
Constructor and destructor
PPTX
Cs1123 12 structures
PPTX
Functional Aspect Of Rust
PPTX
Constructors
PPTX
constructor & destructor in cpp
PPT
Structure in c
PPTX
Object Oriented Programming - Constructors & Destructors
Constructor overloading & method overloading
C++ Constructor destructor
Oop lec 5-(class objects, constructor & destructor)
constructor and destructor
Constructor and Destructor PPT
Constructor and Destructor
Constructor and destructor
constructor with default arguments and dynamic initialization of objects
Constructor & destructor
Constructors and Destructors
Constructor and Destructors in C++
Constructor and desturctor
Lecture 4.2 c++(comlete reference book)
Constructor and destructor
Cs1123 12 structures
Functional Aspect Of Rust
Constructors
constructor & destructor in cpp
Structure in c
Object Oriented Programming - Constructors & Destructors
Ad

Similar to Next Generation of Javascript (20)

PDF
Sharable of qualities of clean code
PDF
Functional Programming 101 for Java 7 Developers
PDF
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
PPTX
1P13 Python Review Session Covering various Topics
PDF
Object Oriented Programming (OOP) using C++ - Lecture 1
PDF
Compiling EdgeQL
PDF
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...
PPTX
Introduction to the aerospike jdbc driver
PDF
Introduction to JQ
PDF
Multiple graphs in openCypher
PPTX
ECMAScript 6 and the Node Driver
PDF
C Programming - Refresher - Part IV
PPTX
Module 1 - Programming Fundamentals.pptx
PDF
Software Developer Training
PPT
Sql Patterns
PPTX
Javascript ES6
PDF
JavaScript: Patterns, Part 2
PPTX
Robust C++ Task Systems Through Compile-time Checks
PDF
Python for web security - beginner
PDF
JDBC Driver for Aerospike - Meetup Dec 2019
Sharable of qualities of clean code
Functional Programming 101 for Java 7 Developers
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
1P13 Python Review Session Covering various Topics
Object Oriented Programming (OOP) using C++ - Lecture 1
Compiling EdgeQL
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...
Introduction to the aerospike jdbc driver
Introduction to JQ
Multiple graphs in openCypher
ECMAScript 6 and the Node Driver
C Programming - Refresher - Part IV
Module 1 - Programming Fundamentals.pptx
Software Developer Training
Sql Patterns
Javascript ES6
JavaScript: Patterns, Part 2
Robust C++ Task Systems Through Compile-time Checks
Python for web security - beginner
JDBC Driver for Aerospike - Meetup Dec 2019
Ad

More from Squash Apps Pvt Ltd (15)

PPTX
The Critical role of Copyright
PPTX
Please review and merge
PPTX
Angular Lifecycle Hooks
PPTX
Hybrid app development frameworks
PPTX
API Gateway with legend lambada
PPTX
Life Cycle hooks in VueJs
PPTX
An Intro into webpack
PPTX
Lets vue(view) Vuex from the Top Vue(View)
PPTX
An Overview on Nuxt.js
PPTX
Sharing Data Between Angular Components
PPTX
AWS Jungle - Lambda
PPTX
Angular Lazy Loading and Resolve (Route Resolver)
PPTX
Basics of NGINX
ODP
Basics of VueJS
The Critical role of Copyright
Please review and merge
Angular Lifecycle Hooks
Hybrid app development frameworks
API Gateway with legend lambada
Life Cycle hooks in VueJs
An Intro into webpack
Lets vue(view) Vuex from the Top Vue(View)
An Overview on Nuxt.js
Sharing Data Between Angular Components
AWS Jungle - Lambda
Angular Lazy Loading and Resolve (Route Resolver)
Basics of NGINX
Basics of VueJS

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
cuic standard and advanced reporting.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
KodekX | Application Modernization Development
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
Cloud computing and distributed systems.
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Big Data Technologies - Introduction.pptx
Modernizing your data center with Dell and AMD
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Monthly Chronicles - July 2025
Understanding_Digital_Forensics_Presentation.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
cuic standard and advanced reporting.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
The AUB Centre for AI in Media Proposal.docx
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars
KodekX | Application Modernization Development
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Building Integrated photovoltaic BIPV_UPV.pdf
Electronic commerce courselecture one. Pdf
Cloud computing and distributed systems.
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm

Next Generation of Javascript

  • 1. NEXT GENERATION OF JAVASCRIPT PREMKUMAR M, Software Engineer, 1
  • 2. Agenda ● Data Types ● Spread & Rest Operator ● Destructuring ● Classes ● Imports & Exports ● Arrow Functions 2
  • 4. Spread & Rest Triple Dot (...) 4
  • 5. Spread 5 The spread operator “spreads” the values in an iterable (arrays, strings) across zero or more arguments or elements.
  • 6. Rest 6 The rest parameter gives us an easier and cleaner way of working with an indefinite number of parameters.
  • 7. Destructuring ● Destructuring is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables. ● That is, we can extract data from arrays and objects and assign them to variables. ● Types of Destructuring ○ Array Destructuring ○ Object Destructuring 7
  • 8. Array Destructuring - Examples ● const [ name1, name2 ] = [ ‘John’, ‘Peter’, ‘Jack’ ] ● const [ name1, ,name2 ] = [ ‘John’, ‘Peter’, ‘Jack’ ] ● const [ name1, ...names ] = [ ‘John’, ‘Peter’, ‘Jack’ ] ● const [ name1, , , name4= ’Mickel’ ] = [ ‘John’, ‘Peter’, ‘Jack’ ] ● const newArray = [...nameArray, ‘Mike’] 8 Swapping the values const var1 =1 const var2 = 2 [ var2, var1 ] = [ var1, var2]
  • 9. Object Destructuring - Examples const employee = { name: ‘John’, ‘Age’: 23, Country: [ ‘Sydney’, ’London’ ]} ● const { name, Age = 18 } = employee ● const { Age: empAge } = employee ● const { Country: [country1]} = employee ● const {name, ...otherDetails} = employee ● const newObj = { ...employee } 9 const prop = ‘name’ const {[prop]: firstName} = employee
  • 10. Classes ● Less code setup — Who doesn’t want to write less code? With ES6 classes the code to write a function is much lesser compared to the traditional method. ● Constructor function — it provides a clear function to create objects. ● All the logic is contained — You can clearly specify the methods and properties in one place instead of creating one constructor function and defining methods on the prototype one-by-one. 10
  • 11. Imports & Exports There are 4 types of exports: 1— Named exports (several per module) 2— Default exports (one per module) 3— Mixed named & default exports 4— Cyclic Dependencies 11 MORE
  • 12. Arrow Functions / Fat Arrow Functions 12 Arrow functions are a more concise syntax for writing function expressions. Arrow Functions have two main benefits: ● A shorter syntax then typical functions ● No binding of this
  • 13. No Binding of this function Counter() { this.num = 0; this.timer = setInterval(function add() { this.num++; console.log(this.num); }, 1000); } var a = new Counter(); 13 function Counter() { this.num = 0; this.timer = setInterval(() => { this.num++; console.log(this.num); }, 1000); } var a = new Counter();
  • 14. 14
  • 15. 15