You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
2459
2459
2460
-
```javascript
2461
-
constisOdd= (number) => number %2===1;
2462
-
constnumbers= [1, 2, 3, 4, 5];
2460
+
```javascript
2461
+
constisOdd= (number) => number %2===1;
2462
+
constnumbers= [1, 2, 3, 4, 5];
2463
2463
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
+
```
2467
2467
2468
2468
2. ### hashbang-syntax
2469
2469
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
2474
2474
'use strict';
2475
2475
console.log("Hello world from hashbang syntax");
2476
2476
```
2477
+
2477
2478
3. ### symbols-as-weakmap-keys
2478
2479
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.
2479
2480
@@ -2493,6 +2494,7 @@ Most of these features already supported by some browsers and try out with babel
2493
2494
2494
2495
console.log(weak.get(key)); //ES2023
2495
2496
```
2497
+
2496
2498
4. ### change-array-by-copy
2497
2499
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.
0 commit comments