Skip to content

Commit 0a5bfca

Browse files
committed
Format ES2023 content
1 parent 11d2f61 commit 0a5bfca

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2455,15 +2455,15 @@ Most of these features already supported by some browsers and try out with babel
24552455
console.log(reverseNumbers.find(isOdd)); // 5
24562456
console.log(reverseNumbers.findIndex(isOdd)); // 4
24572457
```
2458-
This process is going to be simiplified in ES2023 release using **findLast()** and **findLastIndex()** methods.
2458+
This process is going to be simiplified in ES2023 release using **findLast()** and **findLastIndex()** methods.
24592459
2460-
```javascript
2461-
const isOdd = (number) => number % 2 === 1;
2462-
const numbers = [1, 2, 3, 4, 5];
2460+
```javascript
2461+
const isOdd = (number) => number % 2 === 1;
2462+
const numbers = [1, 2, 3, 4, 5];
24632463

2464-
console.log(numbers.findLast(isOdd)); // 5
2465-
console.log(numbers.findLastIndex(isOdd)); // 4
2466-
```
2464+
console.log(numbers.findLast(isOdd)); // 5
2465+
console.log(numbers.findLastIndex(isOdd)); // 4
2466+
```
24672467
24682468
2. ### hashbang-syntax
24692469
Hashbang(as known as shebang) grammer has been supported with a sequence of characters(#!) at the beginning of an executable script to define the interpreter for the program to run. In other words, this syntax is helpful to tell the operating system which interpreter to use while executing the script.
@@ -2474,6 +2474,7 @@ Most of these features already supported by some browsers and try out with babel
24742474
'use strict';
24752475
console.log("Hello world from hashbang syntax");
24762476
```
2477+
24772478
3. ### symbols-as-weakmap-keys
24782479
Prior to ES2023, WeakMaps are only limited to allow objects as keys because objects are unique and cannot be re-created. Since symbols are the only primitives in ECMAScript that allows unique values, WeakMap API has been extended with symbols as keys instead of just using objects.
24792480
@@ -2493,6 +2494,7 @@ Most of these features already supported by some browsers and try out with babel
24932494

24942495
console.log(weak.get(key)); //ES2023
24952496
```
2497+
24962498
4. ### change-array-by-copy
24972499
Both **Array** and **TypedArray** has built-in methods such as **reverse()**, **sort()** and **splice()** to perform common actions like sorting, reverse the array elements and replacing(or removing) elements. But these methods are mutating the original array. Where as ES2023 has provided additional methods such as **toReversed()**, **toSorted()**, **toSpliced** and **with()** methods which returns new array copies instead of mutating the original array.
24982500

0 commit comments

Comments
 (0)