SlideShare a Scribd company logo
ES10 NEW FEATURES
&
REACT INTRODUCTION
Amanpreet Singh
String.trimStart()04
Array.flatMap()03
Array.flat()02
BigInt01
ES10 Key Features
String.trimEnd()05
Function.toString()09
Object.fromEntries()08
Dynamic import07
Optional Catch Binding06
ES10 Key Features
string.prototype.matchAll()10
BigInt is the 7th primitive type.
With BigInteger, you don't have that problem, because once the
assigned bits are not enough to store the exact value, BigInteger
will just add some bits so it can handle the value again.
● const b = 1n
● typeof 10n == 'bigint'
● 10n === BigInt(10)
● 10n == 10
● 200n / 20
--Uncaught TypeError
Flattening of a multi-dimensional array:
The flat() method creates a new array with all sub-array elements
concatenated into it recursively up to the specified depth.
Array.flat()
let multi = [1,2,3,[4,5,6,[7,8,9,[10,11,12]]]];
multi.flat(); // [1,2,3,4,5,6,Array(4)]
multi.flat().flat(); // [1,2,3,4,5,6,7,8,9,Array(3)]
multi.flat().flat().flat(); // [1,2,3,4,5,6,7,8,9,10,11,12]
multi.flat(Infinity); // [1,2,3,4,5,6,7,8,9,10,11,12]
BigInt
The flatMap() method first maps each element using a
mapping function, then flattens the result into a new array.
var arr = [1,2,3,4,5]
arr.map(x => [x, x*2])
// [Array(2), Array(2), Array(2), Array(2), Array(2)]
// 0: (2) [1, 2]
// 1: (2) [2, 4]
// 2: (2) [3, 6]
// 3: (2) [4, 8]
// 4: (2) [5, 10]
arr.flatMap(x => [x,x*2])
// [1, 2, 2, 4, 3, 6, 4, 8, 5, 10]
The trimStart() method removes whitespace from the
beginning of a string.
String.trimStart()
var greeting = " Hello World! ";
console.log(greeting.trimStart());
// “Hello World! “
Array.flatMap()
The trimEnd() method removes whitespace from the end of
a string.
var greeting = " Hello World! ";
console.log(greeting.trimEnd());
// “ Hello World!“
Allow developers to use try/catch without creating an
unused binding..
Optional Catch Binding
try {
throw new Error(“some errors”);
} catch {
console.log(‘No params for catch’);
}
String.trimEnd()
The Object.fromEntries() method transforms a list of
key-value pairs into an object
.
Note: Object.fromEntries only accept iterable (i.e)
Object.fromEntries(iterable)
var entries = new Map([
[‘name’,’aman’],
[‘exp’,’3’]])
Object.fromEntries(entries)
The toString() method returns a string representing the
source code of the function.
Function.toString()
function sayHi(){
console.log(‘say Hi’);
}
console.log(sayHI.toString());
// function sayHI(){
// console.log(‘say Hi’);
// }
Object.fromEntries()
The import(module) expression loads the module and
returns a promise that resolves into a module object that
contains all its exports. It can be called from any place in the
code.
let modulePath = prompt("Which module to load?");
import(modulePath)
.then(obj => <module object>)
.catch(err => <loading error, e.g. if no such
module>)
It returns an iterator instead of array. Iterators on their own
are useful.
It avoids regular expressions with /g flag
string.prototype.matchAll()
// Match all occurrences of the letters: "e" or "l"
let iterator = "hello".matchAll(/[el]/);
for (const match of iterator)
console.log(match);
Dynamic import
WHAT IS REACT ?
React is a declarative, efficient, and
flexible JavaScript library for building
user interfaces. It lets you compose
complex UIs from small and isolated
pieces of code called “components”.
● React is not a framework
● React is an open-source
project created by Facebook
COMPONENT
Components let you
split the UI into
independent, reusable
pieces, and think about
each piece in isolation.
JSX - JAVASCRIPT + HTML
JSX is an XML/HTML-like
syntax used by React that
extends ECMAScript so that
XML/HTML-like text can
co-exist with
JavaScript/React code.
Props are an effective way
to pass existing data to a
React component, however
the component cannot
change the props - they're
read-only.
Props
You should always use keys
when making lists in React,
as they help identify each
list item.
Vestibulum congue tempu
Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do
eiusmod tempor.
STATE
State is similar to props, but
it is private and fully
controlled by the
component.
You can think of state as
any data that should be
saved and modified without
necessarily being added to
a database
Now we have delete
buttons, and we can
modify our state by
deleting a character.
React Compononent Life Cycle
Updating
Mounting
Unmounting
JavaScript ES10 and React Js Introduction
REACT
COMPARISON
HISTORY
POPULARITY
JOB MARKET
COMMUNITY AND DEVELOPMENT
WHO WINS?

More Related Content

What's hot (20)

PPTX
Synapse india dotnet development overloading operater part 3
Synapseindiappsdevelopment
 
PPTX
C++20 features
LogeekNightUkraine
 
PDF
The Ring programming language version 1.5.2 book - Part 175 of 181
Mahmoud Samir Fayed
 
PDF
P3
lksoo
 
PPTX
Learning C++ - Functions in C++ 3
Ali Aminian
 
PDF
Functions
Kamal Acharya
 
PPTX
Operator Overloading
Dustin Chase
 
PPT
Computer notes - Reference Variables –II
ecomputernotes
 
PPTX
Operator overloading2
zindadili
 
PDF
Serious Sam shooter anniversary - finding bugs in the code of the Serious Eng...
PVS-Studio
 
PPT
Functions in C++
Sachin Sharma
 
PDF
In what way can C++0x standard help you eliminate 64-bit errors
PVS-Studio
 
PDF
Andrii Orlov "Generators Flexibility in Modern Code"
LogeekNightUkraine
 
PPT
Operator Overloading
Sardar Alam
 
PPTX
C++ programming function
Vishalini Mugunen
 
PPT
Dd3.15 thru-3.21-advanced-functions
temkin abdlkader
 
PDF
C++17 introduction - Meetup @EtixLabs
Stephane Gleizes
 
PPTX
BB - Functions (Operations and Piecewise)
JosefMikaeldelCorro
 
PPTX
MCM FUNCTIONS BLACKBOARD COMPATIBILITY
JosefMikaeldelCorro1
 
PDF
Time for Functions
simontcousins
 
Synapse india dotnet development overloading operater part 3
Synapseindiappsdevelopment
 
C++20 features
LogeekNightUkraine
 
The Ring programming language version 1.5.2 book - Part 175 of 181
Mahmoud Samir Fayed
 
P3
lksoo
 
Learning C++ - Functions in C++ 3
Ali Aminian
 
Functions
Kamal Acharya
 
Operator Overloading
Dustin Chase
 
Computer notes - Reference Variables –II
ecomputernotes
 
Operator overloading2
zindadili
 
Serious Sam shooter anniversary - finding bugs in the code of the Serious Eng...
PVS-Studio
 
Functions in C++
Sachin Sharma
 
In what way can C++0x standard help you eliminate 64-bit errors
PVS-Studio
 
Andrii Orlov "Generators Flexibility in Modern Code"
LogeekNightUkraine
 
Operator Overloading
Sardar Alam
 
C++ programming function
Vishalini Mugunen
 
Dd3.15 thru-3.21-advanced-functions
temkin abdlkader
 
C++17 introduction - Meetup @EtixLabs
Stephane Gleizes
 
BB - Functions (Operations and Piecewise)
JosefMikaeldelCorro
 
MCM FUNCTIONS BLACKBOARD COMPATIBILITY
JosefMikaeldelCorro1
 
Time for Functions
simontcousins
 

Similar to JavaScript ES10 and React Js Introduction (20)

PDF
Whats new in ES2019
chayanikaa
 
PDF
Intro to React
Troy Miles
 
PDF
React Native Evening
Troy Miles
 
PDF
React Development with the MERN Stack
Troy Miles
 
PDF
React Native One Day
Troy Miles
 
PPTX
8558537werr.pptx
ssuser8a9aac
 
PPTX
Javascript
Tarek Raihan
 
PPTX
Java script
Adrian Caetano
 
PDF
Angular Weekend
Troy Miles
 
PDF
React for Beginners
Derek Willian Stavis
 
PDF
TDC2016SP - Trilha Frameworks JavaScript
tdc-globalcode
 
PPTX
Front end fundamentals session 1: javascript core
Web Zhao
 
PPTX
Module 2 Javascript. Advanced concepts of javascript
BKReddy3
 
PDF
Node Boot Camp
Troy Miles
 
PPTX
React_Complete.pptx
kamalakantas
 
PPTX
React js
Oswald Campesato
 
PDF
What's New in JavaScript
Dan Cohn
 
PDF
Workshop React.js
Commit University
 
PPTX
Getting started with ES6
Nitay Neeman
 
PDF
You Don t Know JS ES6 Beyond Kyle Simpson
gedayelife
 
Whats new in ES2019
chayanikaa
 
Intro to React
Troy Miles
 
React Native Evening
Troy Miles
 
React Development with the MERN Stack
Troy Miles
 
React Native One Day
Troy Miles
 
8558537werr.pptx
ssuser8a9aac
 
Javascript
Tarek Raihan
 
Java script
Adrian Caetano
 
Angular Weekend
Troy Miles
 
React for Beginners
Derek Willian Stavis
 
TDC2016SP - Trilha Frameworks JavaScript
tdc-globalcode
 
Front end fundamentals session 1: javascript core
Web Zhao
 
Module 2 Javascript. Advanced concepts of javascript
BKReddy3
 
Node Boot Camp
Troy Miles
 
React_Complete.pptx
kamalakantas
 
What's New in JavaScript
Dan Cohn
 
Workshop React.js
Commit University
 
Getting started with ES6
Nitay Neeman
 
You Don t Know JS ES6 Beyond Kyle Simpson
gedayelife
 
Ad

Recently uploaded (20)

PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Ad

JavaScript ES10 and React Js Introduction

  • 1. ES10 NEW FEATURES & REACT INTRODUCTION Amanpreet Singh
  • 3. Function.toString()09 Object.fromEntries()08 Dynamic import07 Optional Catch Binding06 ES10 Key Features string.prototype.matchAll()10
  • 4. BigInt is the 7th primitive type. With BigInteger, you don't have that problem, because once the assigned bits are not enough to store the exact value, BigInteger will just add some bits so it can handle the value again. ● const b = 1n ● typeof 10n == 'bigint' ● 10n === BigInt(10) ● 10n == 10 ● 200n / 20 --Uncaught TypeError Flattening of a multi-dimensional array: The flat() method creates a new array with all sub-array elements concatenated into it recursively up to the specified depth. Array.flat() let multi = [1,2,3,[4,5,6,[7,8,9,[10,11,12]]]]; multi.flat(); // [1,2,3,4,5,6,Array(4)] multi.flat().flat(); // [1,2,3,4,5,6,7,8,9,Array(3)] multi.flat().flat().flat(); // [1,2,3,4,5,6,7,8,9,10,11,12] multi.flat(Infinity); // [1,2,3,4,5,6,7,8,9,10,11,12] BigInt
  • 5. The flatMap() method first maps each element using a mapping function, then flattens the result into a new array. var arr = [1,2,3,4,5] arr.map(x => [x, x*2]) // [Array(2), Array(2), Array(2), Array(2), Array(2)] // 0: (2) [1, 2] // 1: (2) [2, 4] // 2: (2) [3, 6] // 3: (2) [4, 8] // 4: (2) [5, 10] arr.flatMap(x => [x,x*2]) // [1, 2, 2, 4, 3, 6, 4, 8, 5, 10] The trimStart() method removes whitespace from the beginning of a string. String.trimStart() var greeting = " Hello World! "; console.log(greeting.trimStart()); // “Hello World! “ Array.flatMap()
  • 6. The trimEnd() method removes whitespace from the end of a string. var greeting = " Hello World! "; console.log(greeting.trimEnd()); // “ Hello World!“ Allow developers to use try/catch without creating an unused binding.. Optional Catch Binding try { throw new Error(“some errors”); } catch { console.log(‘No params for catch’); } String.trimEnd()
  • 7. The Object.fromEntries() method transforms a list of key-value pairs into an object . Note: Object.fromEntries only accept iterable (i.e) Object.fromEntries(iterable) var entries = new Map([ [‘name’,’aman’], [‘exp’,’3’]]) Object.fromEntries(entries) The toString() method returns a string representing the source code of the function. Function.toString() function sayHi(){ console.log(‘say Hi’); } console.log(sayHI.toString()); // function sayHI(){ // console.log(‘say Hi’); // } Object.fromEntries()
  • 8. The import(module) expression loads the module and returns a promise that resolves into a module object that contains all its exports. It can be called from any place in the code. let modulePath = prompt("Which module to load?"); import(modulePath) .then(obj => <module object>) .catch(err => <loading error, e.g. if no such module>) It returns an iterator instead of array. Iterators on their own are useful. It avoids regular expressions with /g flag string.prototype.matchAll() // Match all occurrences of the letters: "e" or "l" let iterator = "hello".matchAll(/[el]/); for (const match of iterator) console.log(match); Dynamic import
  • 10. React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It lets you compose complex UIs from small and isolated pieces of code called “components”. ● React is not a framework ● React is an open-source project created by Facebook
  • 11. COMPONENT Components let you split the UI into independent, reusable pieces, and think about each piece in isolation.
  • 12. JSX - JAVASCRIPT + HTML JSX is an XML/HTML-like syntax used by React that extends ECMAScript so that XML/HTML-like text can co-exist with JavaScript/React code.
  • 13. Props are an effective way to pass existing data to a React component, however the component cannot change the props - they're read-only. Props
  • 14. You should always use keys when making lists in React, as they help identify each list item.
  • 15. Vestibulum congue tempu Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor. STATE State is similar to props, but it is private and fully controlled by the component.
  • 16. You can think of state as any data that should be saved and modified without necessarily being added to a database
  • 17. Now we have delete buttons, and we can modify our state by deleting a character.
  • 18. React Compononent Life Cycle Updating Mounting Unmounting