0% found this document useful (0 votes)
6 views10 pages

Exciting New Javascript Concepts

The document outlines several new features introduced in ECMAScript 2020, including optional chaining, nullish coalescing, and BigInt for handling large integers. It also discusses new methods like matchAll() for string matching and Promise.allSettled() for handling promises. Additionally, it highlights the globalThis object and the new Error property for specifying error causes.

Uploaded by

amazonha99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views10 pages

Exciting New Javascript Concepts

The document outlines several new features introduced in ECMAScript 2020, including optional chaining, nullish coalescing, and BigInt for handling large integers. It also discusses new methods like matchAll() for string matching and Promise.allSettled() for handling promises. Additionally, it highlights the globalThis object and the new Error property for specifying error causes.

Uploaded by

amazonha99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Yasir N.

www.yasirnawaz.me
@sudoyasir

1/9
Yasir N.
www.yasirnawaz.me
@sudoyasir

1. Optional Chaining (?.)


Introduced in ECMAScript 2020, optional chaining allows you to
read the value of a property located deep within a chain of
connected objects without having to check that each reference
in the chain is valid.

2/9
Yasir N.
www.yasirnawaz.me
@sudoyasir

2. Nullish Coalescing (??)


Also introduced in ECMAScript 2020, the nullish coalescing
operator returns the first operand if it's not null or undefined,
and the second operand otherwise.

3/9
Yasir N.
www.yasirnawaz.me
@sudoyasir

3. BigInt
A new numeric primitive in JavaScript, BigInt is used to
represent integers with arbitrary precision, allowing for accurate
calculations with large integers.

4/9
Yasir N.
www.yasirnawaz.me
@sudoyasir

4. globalThis
A new global object, globalThis, provides a way to access the
global object in a way that's compatible with modern
JavaScript environments.

5/9
Yasir N.
www.yasirnawaz.me
@sudoyasir

5. matchAll()
A new method on the String prototype, matchAll() returns an
iterator that yields matches of a regular expression against a
string, including capturing groups.

6/9
Yasir N.
www.yasirnawaz.me
@sudoyasir

6. Promise.allSettled()
A new method on the Promise API, allSettled() returns a promise
that is resolved when all of the promises in an array are either
resolved or rejected.

7/9
Yasir N.
www.yasirnawaz.me
@sudoyasir

7. String.prototype.at()
A new method on the String prototype, at() returns the
character at the specified index, allowing for negative indices to
access characters from the end of the string.

8/9
Yasir N.
www.yasirnawaz.me
@sudoyasir

8. Error Cause
A new property on Error objects, cause allows you to specify the
underlying cause of an error.

9/9

You might also like