SlideShare a Scribd company logo
1 of 25
Download to read offline
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
REACT
COMPARISON
HISTORY
POPULARITY
JOB MARKET
COMMUNITY AND DEVELOPMENT
WHO WINS?

More Related Content

What's hot

Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3Synapseindiappsdevelopment
 
The Ring programming language version 1.5.2 book - Part 175 of 181
The Ring programming language version 1.5.2 book - Part 175 of 181The Ring programming language version 1.5.2 book - Part 175 of 181
The Ring programming language version 1.5.2 book - Part 175 of 181Mahmoud Samir Fayed
 
Learning C++ - Functions in C++ 3
Learning C++ - Functions  in C++ 3Learning C++ - Functions  in C++ 3
Learning C++ - Functions in C++ 3Ali Aminian
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator OverloadingDustin Chase
 
Computer notes - Reference Variables –II
Computer notes  - Reference Variables –IIComputer notes  - Reference Variables –II
Computer notes - Reference Variables –IIecomputernotes
 
Operator overloading2
Operator overloading2Operator overloading2
Operator overloading2zindadili
 
Serious Sam shooter anniversary - finding bugs in the code of the Serious Eng...
Serious Sam shooter anniversary - finding bugs in the code of the Serious Eng...Serious Sam shooter anniversary - finding bugs in the code of the Serious Eng...
Serious Sam shooter anniversary - finding bugs in the code of the Serious Eng...PVS-Studio
 
In what way can C++0x standard help you eliminate 64-bit errors
In what way can C++0x standard help you eliminate 64-bit  errorsIn what way can C++0x standard help you eliminate 64-bit  errors
In what way can C++0x standard help you eliminate 64-bit errorsPVS-Studio
 
Andrii Orlov "Generators Flexibility in Modern Code"
Andrii Orlov "Generators Flexibility in Modern Code"Andrii Orlov "Generators Flexibility in Modern Code"
Andrii Orlov "Generators Flexibility in Modern Code"LogeekNightUkraine
 
Operator Overloading
Operator Overloading  Operator Overloading
Operator Overloading Sardar Alam
 
Dd3.15 thru-3.21-advanced-functions
Dd3.15 thru-3.21-advanced-functionsDd3.15 thru-3.21-advanced-functions
Dd3.15 thru-3.21-advanced-functionstemkin abdlkader
 
C++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabsC++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabsStephane Gleizes
 
BB - Functions (Operations and Piecewise)
BB  - Functions (Operations and Piecewise)BB  - Functions (Operations and Piecewise)
BB - Functions (Operations and Piecewise)JosefMikaeldelCorro
 
MCM FUNCTIONS BLACKBOARD COMPATIBILITY
MCM FUNCTIONS BLACKBOARD COMPATIBILITYMCM FUNCTIONS BLACKBOARD COMPATIBILITY
MCM FUNCTIONS BLACKBOARD COMPATIBILITYJosefMikaeldelCorro1
 

What's hot (20)

Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3
 
C++20 features
C++20 features C++20 features
C++20 features
 
The Ring programming language version 1.5.2 book - Part 175 of 181
The Ring programming language version 1.5.2 book - Part 175 of 181The Ring programming language version 1.5.2 book - Part 175 of 181
The Ring programming language version 1.5.2 book - Part 175 of 181
 
P3
P3P3
P3
 
Learning C++ - Functions in C++ 3
Learning C++ - Functions  in C++ 3Learning C++ - Functions  in C++ 3
Learning C++ - Functions in C++ 3
 
Functions
FunctionsFunctions
Functions
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
 
Computer notes - Reference Variables –II
Computer notes  - Reference Variables –IIComputer notes  - Reference Variables –II
Computer notes - Reference Variables –II
 
Operator overloading2
Operator overloading2Operator overloading2
Operator overloading2
 
Serious Sam shooter anniversary - finding bugs in the code of the Serious Eng...
Serious Sam shooter anniversary - finding bugs in the code of the Serious Eng...Serious Sam shooter anniversary - finding bugs in the code of the Serious Eng...
Serious Sam shooter anniversary - finding bugs in the code of the Serious Eng...
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
In what way can C++0x standard help you eliminate 64-bit errors
In what way can C++0x standard help you eliminate 64-bit  errorsIn what way can C++0x standard help you eliminate 64-bit  errors
In what way can C++0x standard help you eliminate 64-bit errors
 
Andrii Orlov "Generators Flexibility in Modern Code"
Andrii Orlov "Generators Flexibility in Modern Code"Andrii Orlov "Generators Flexibility in Modern Code"
Andrii Orlov "Generators Flexibility in Modern Code"
 
Operator Overloading
Operator Overloading  Operator Overloading
Operator Overloading
 
C++ programming function
C++ programming functionC++ programming function
C++ programming function
 
Dd3.15 thru-3.21-advanced-functions
Dd3.15 thru-3.21-advanced-functionsDd3.15 thru-3.21-advanced-functions
Dd3.15 thru-3.21-advanced-functions
 
C++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabsC++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabs
 
BB - Functions (Operations and Piecewise)
BB  - Functions (Operations and Piecewise)BB  - Functions (Operations and Piecewise)
BB - Functions (Operations and Piecewise)
 
MCM FUNCTIONS BLACKBOARD COMPATIBILITY
MCM FUNCTIONS BLACKBOARD COMPATIBILITYMCM FUNCTIONS BLACKBOARD COMPATIBILITY
MCM FUNCTIONS BLACKBOARD COMPATIBILITY
 
Time for Functions
Time for FunctionsTime for Functions
Time for Functions
 

Similar to JavaScript ES10 and React Js Introduction

data Structure Lecture 1
data Structure Lecture 1data Structure Lecture 1
data Structure Lecture 1Teksify
 
K is for Kotlin
K is for KotlinK is for Kotlin
K is for KotlinTechMagic
 
Introduction to ES2015
Introduction to ES2015Introduction to ES2015
Introduction to ES2015kiranabburi
 
EcmaScript unchained
EcmaScript unchainedEcmaScript unchained
EcmaScript unchainedEduard Tomàs
 
Making Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVMMaking Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVMRafael Winterhalter
 
2 introduction toentitybeans
2 introduction toentitybeans2 introduction toentitybeans
2 introduction toentitybeansashishkirpan
 
How much performance can you get out of Javascript? - Massimiliano Mantione -...
How much performance can you get out of Javascript? - Massimiliano Mantione -...How much performance can you get out of Javascript? - Massimiliano Mantione -...
How much performance can you get out of Javascript? - Massimiliano Mantione -...Codemotion
 
2. Design patterns. part #2
2. Design patterns. part #22. Design patterns. part #2
2. Design patterns. part #2Leonid Maslov
 
12 Monkeys Inside JS Engine
12 Monkeys Inside JS Engine12 Monkeys Inside JS Engine
12 Monkeys Inside JS EngineChengHui Weng
 
do ruby ao golang: o que aprendi criando um microserviço depois de 5000 commits
do ruby ao golang: o que aprendi criando um microserviço depois de 5000 commitsdo ruby ao golang: o que aprendi criando um microserviço depois de 5000 commits
do ruby ao golang: o que aprendi criando um microserviço depois de 5000 commitsAndreLeoni1
 
Priming Java for Speed at Market Open
Priming Java for Speed at Market OpenPriming Java for Speed at Market Open
Priming Java for Speed at Market OpenAzul Systems Inc.
 
Functional programming-advantages
Functional programming-advantagesFunctional programming-advantages
Functional programming-advantagesSergei Winitzki
 
Exceptions irst
Exceptions irstExceptions irst
Exceptions irstjkumaranc
 
Oops lab manual2
Oops lab manual2Oops lab manual2
Oops lab manual2Mouna Guru
 

Similar to JavaScript ES10 and React Js Introduction (20)

data Structure Lecture 1
data Structure Lecture 1data Structure Lecture 1
data Structure Lecture 1
 
K is for Kotlin
K is for KotlinK is for Kotlin
K is for Kotlin
 
Introduction to ES2015
Introduction to ES2015Introduction to ES2015
Introduction to ES2015
 
EcmaScript unchained
EcmaScript unchainedEcmaScript unchained
EcmaScript unchained
 
Introduction to kotlin
Introduction to kotlinIntroduction to kotlin
Introduction to kotlin
 
Making Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVMMaking Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVM
 
2 introduction toentitybeans
2 introduction toentitybeans2 introduction toentitybeans
2 introduction toentitybeans
 
Java Generics
Java GenericsJava Generics
Java Generics
 
How much performance can you get out of Javascript? - Massimiliano Mantione -...
How much performance can you get out of Javascript? - Massimiliano Mantione -...How much performance can you get out of Javascript? - Massimiliano Mantione -...
How much performance can you get out of Javascript? - Massimiliano Mantione -...
 
2. Design patterns. part #2
2. Design patterns. part #22. Design patterns. part #2
2. Design patterns. part #2
 
12 Monkeys Inside JS Engine
12 Monkeys Inside JS Engine12 Monkeys Inside JS Engine
12 Monkeys Inside JS Engine
 
do ruby ao golang: o que aprendi criando um microserviço depois de 5000 commits
do ruby ao golang: o que aprendi criando um microserviço depois de 5000 commitsdo ruby ao golang: o que aprendi criando um microserviço depois de 5000 commits
do ruby ao golang: o que aprendi criando um microserviço depois de 5000 commits
 
Priming Java for Speed at Market Open
Priming Java for Speed at Market OpenPriming Java for Speed at Market Open
Priming Java for Speed at Market Open
 
Arrays
ArraysArrays
Arrays
 
Functional programming-advantages
Functional programming-advantagesFunctional programming-advantages
Functional programming-advantages
 
Java vs kotlin
Java vs kotlinJava vs kotlin
Java vs kotlin
 
Exceptions irst
Exceptions irstExceptions irst
Exceptions irst
 
Namespaces
NamespacesNamespaces
Namespaces
 
Oops lab manual2
Oops lab manual2Oops lab manual2
Oops lab manual2
 
Day 1
Day 1Day 1
Day 1
 

Recently uploaded

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Recently uploaded (20)

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

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
  • 19.