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
Ad

Recommended

PPTX
constructors in java ppt
kunal kishore
 
PPTX
C++Constructors
Nusrat Gulbarga
 
PPTX
Constructor and Destructor in c++
aleenaguen
 
PPT
Constructor & Destructor
KV(AFS) Utarlai, Barmer (Rajasthan)
 
PPTX
Constructor ppt
Vinod Kumar
 
PDF
Constructors and Destructors
Dr Sukhpal Singh Gill
 
PPTX
Constructor and Types of Constructors
Dhrumil Panchal
 
PPTX
Constructor overloading & method overloading
garishma bhatia
 
PPTX
C++ Constructor destructor
Da Mystic Sadi
 
PPT
Oop lec 5-(class objects, constructor & destructor)
Asfand Hassan
 
PPTX
constructor and destructor
VENNILAV6
 
PPT
Constructor and Destructor PPT
Shubham Mondal
 
PDF
Constructor and Destructor
Kamal Acharya
 
PPTX
Constructor and destructor
Shubham Vishwambhar
 
PPTX
constructor with default arguments and dynamic initialization of objects
Kanhaiya Saxena
 
PPTX
Constructor & destructor
Saharsh Anand
 
PPTX
Constructors and Destructors
Keyur Vadodariya
 
PPTX
Constructor and Destructors in C++
sandeep54552
 
PPTX
Constructor and desturctor
Somnath Kulkarni
 
PPTX
Lecture 4.2 c++(comlete reference book)
Abu Saleh
 
PPSX
Constructor and destructor
Selvin Josy Bai Somu
 
PPTX
Cs1123 12 structures
TAlha MAlik
 
PPTX
Functional Aspect Of Rust
Knoldus Inc.
 
PPTX
Constructors
shravani2191
 
PPTX
constructor & destructor in cpp
gourav kottawar
 
PPT
Structure in c
Samsil Arefin
 
PPTX
Object Oriented Programming - Constructors & Destructors
Dudy Ali
 
PDF
Sharable of qualities of clean code
Eman Mohamed
 
PDF
Functional Programming 101 for Java 7 Developers
Jayaram Sankaranarayanan
 

More Related Content

What's hot (20)

PPTX
Constructor overloading & method overloading
garishma bhatia
 
PPTX
C++ Constructor destructor
Da Mystic Sadi
 
PPT
Oop lec 5-(class objects, constructor & destructor)
Asfand Hassan
 
PPTX
constructor and destructor
VENNILAV6
 
PPT
Constructor and Destructor PPT
Shubham Mondal
 
PDF
Constructor and Destructor
Kamal Acharya
 
PPTX
Constructor and destructor
Shubham Vishwambhar
 
PPTX
constructor with default arguments and dynamic initialization of objects
Kanhaiya Saxena
 
PPTX
Constructor & destructor
Saharsh Anand
 
PPTX
Constructors and Destructors
Keyur Vadodariya
 
PPTX
Constructor and Destructors in C++
sandeep54552
 
PPTX
Constructor and desturctor
Somnath Kulkarni
 
PPTX
Lecture 4.2 c++(comlete reference book)
Abu Saleh
 
PPSX
Constructor and destructor
Selvin Josy Bai Somu
 
PPTX
Cs1123 12 structures
TAlha MAlik
 
PPTX
Functional Aspect Of Rust
Knoldus Inc.
 
PPTX
Constructors
shravani2191
 
PPTX
constructor & destructor in cpp
gourav kottawar
 
PPT
Structure in c
Samsil Arefin
 
PPTX
Object Oriented Programming - Constructors & Destructors
Dudy Ali
 
Constructor overloading & method overloading
garishma bhatia
 
C++ Constructor destructor
Da Mystic Sadi
 
Oop lec 5-(class objects, constructor & destructor)
Asfand Hassan
 
constructor and destructor
VENNILAV6
 
Constructor and Destructor PPT
Shubham Mondal
 
Constructor and Destructor
Kamal Acharya
 
Constructor and destructor
Shubham Vishwambhar
 
constructor with default arguments and dynamic initialization of objects
Kanhaiya Saxena
 
Constructor & destructor
Saharsh Anand
 
Constructors and Destructors
Keyur Vadodariya
 
Constructor and Destructors in C++
sandeep54552
 
Constructor and desturctor
Somnath Kulkarni
 
Lecture 4.2 c++(comlete reference book)
Abu Saleh
 
Constructor and destructor
Selvin Josy Bai Somu
 
Cs1123 12 structures
TAlha MAlik
 
Functional Aspect Of Rust
Knoldus Inc.
 
Constructors
shravani2191
 
constructor & destructor in cpp
gourav kottawar
 
Structure in c
Samsil Arefin
 
Object Oriented Programming - Constructors & Destructors
Dudy Ali
 

Similar to Next Generation of Javascript (20)

PDF
Sharable of qualities of clean code
Eman Mohamed
 
PDF
Functional Programming 101 for Java 7 Developers
Jayaram Sankaranarayanan
 
PDF
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
Jitendra Bafna
 
PPTX
1P13 Python Review Session Covering various Topics
hussainmuhd1119
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 1
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Compiling EdgeQL
EdgeDB
 
PDF
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...
Citus Data
 
PPTX
Introduction to the aerospike jdbc driver
Alexander Radzin
 
PDF
Introduction to JQ
Knoldus Inc.
 
PDF
Multiple graphs in openCypher
openCypher
 
PPTX
ECMAScript 6 and the Node Driver
MongoDB
 
PDF
C Programming - Refresher - Part IV
Emertxe Information Technologies Pvt Ltd
 
PPTX
Module 1 - Programming Fundamentals.pptx
GaneshRaghu4
 
PDF
Software Developer Training
rungwiroon komalittipong
 
PPT
Sql Patterns
phanleson
 
PPTX
Javascript ES6
Huy Doan
 
PDF
JavaScript: Patterns, Part 2
Chris Farrell
 
PPTX
Robust C++ Task Systems Through Compile-time Checks
Stoyan Nikolov
 
PDF
Python for web security - beginner
Sanjeev Kumar Jaiswal
 
PDF
JDBC Driver for Aerospike - Meetup Dec 2019
Aerospike
 
Sharable of qualities of clean code
Eman Mohamed
 
Functional Programming 101 for Java 7 Developers
Jayaram Sankaranarayanan
 
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
Jitendra Bafna
 
1P13 Python Review Session Covering various Topics
hussainmuhd1119
 
Object Oriented Programming (OOP) using C++ - Lecture 1
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Compiling EdgeQL
EdgeDB
 
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...
Citus Data
 
Introduction to the aerospike jdbc driver
Alexander Radzin
 
Introduction to JQ
Knoldus Inc.
 
Multiple graphs in openCypher
openCypher
 
ECMAScript 6 and the Node Driver
MongoDB
 
C Programming - Refresher - Part IV
Emertxe Information Technologies Pvt Ltd
 
Module 1 - Programming Fundamentals.pptx
GaneshRaghu4
 
Software Developer Training
rungwiroon komalittipong
 
Sql Patterns
phanleson
 
Javascript ES6
Huy Doan
 
JavaScript: Patterns, Part 2
Chris Farrell
 
Robust C++ Task Systems Through Compile-time Checks
Stoyan Nikolov
 
Python for web security - beginner
Sanjeev Kumar Jaiswal
 
JDBC Driver for Aerospike - Meetup Dec 2019
Aerospike
 
Ad

More from Squash Apps Pvt Ltd (15)

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

Recently uploaded (20)

PDF
Python Conference Singapore - 19 Jun 2025
ninefyi
 
PDF
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
PDF
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
PDF
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
PDF
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
PPTX
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
PPTX
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
PDF
The Growing Value and Application of FME & GenAI
Safe Software
 
PPTX
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
PDF
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
PPTX
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PDF
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
PDF
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
PDF
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
PDF
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
PDF
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
PPTX
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
PDF
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
Python Conference Singapore - 19 Jun 2025
ninefyi
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
The Growing Value and Application of FME & GenAI
Safe Software
 
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 

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