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
Copy file name to clipboardExpand all lines: README.md
+271Lines changed: 271 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,7 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
34
34
| ES2022 Or ES13 | June 2022 |
35
35
| ES2023 Or ES14 | June 2023 |
36
36
| ES2024 Or ES15 | June 2024 |
37
+
| ES2025 Or ES16 | June 2025 |
37
38
38
39
### Table of Contents
39
40
@@ -127,6 +128,11 @@ Each proposal for an ECMAScript feature goes through the following maturity stag
127
128
|7 |[Pipeline Operator](#pipeline-operator)|
128
129
|8 |[Records and Tuples](#records-and-tuples)|
129
130
|9 |[Decorators](#decorators)|
131
+
||**ES2025 Or ES16**|
132
+
|1 |[Set Methods](#set-methods)|
133
+
|2 |[Iterator Helpers](#iterator-helpers)|
134
+
|3 |[Temporal API](#temporal-api-es2025)|
135
+
|4 |[Decorator Metadata](#decorator-metadata)|
130
136
131
137
## ES2015 Or ES6
132
138
@@ -2751,3 +2757,268 @@ Most of these features already supported by some browsers and try out with babel
2751
2757
```
2752
2758
2753
2759
**[⬆ Back to Top](#table-of-contents)**
2760
+
2761
+
## ES2025 or ES16
2762
+
2763
+
ES2025 is planned to be released in June 2025 with several new features and enhancements for JavaScript developers. These features aim to improve developer productivity and code readability.
2764
+
2765
+
1. ### Set Methods
2766
+
2767
+
ES2025 introduces several new methods to the Set prototype that make working with sets more convenient and expressive. These methods provide operations commonly found in set theory, such as union, intersection, and difference.
2768
+
2769
+
```javascript
2770
+
// Create some sample sets
2771
+
constset1=newSet([1, 2, 3, 4, 5]);
2772
+
constset2=newSet([3, 4, 5, 6, 7]);
2773
+
2774
+
// Union - combines elements from both sets
2775
+
constunion=set1.union(set2);
2776
+
console.log([...union]); // [1, 2, 3, 4, 5, 6, 7]
2777
+
2778
+
// Intersection - elements present in both sets
2779
+
constintersection=set1.intersection(set2);
2780
+
console.log([...intersection]); // [3, 4, 5]
2781
+
2782
+
// Difference - elements in first set but not in second
2783
+
constdifference=set1.difference(set2);
2784
+
console.log([...difference]); // [1, 2]
2785
+
2786
+
// Symmetric Difference - elements in either set but not in both
ES2025 introduces Iterator Helpers, which provide a set of utility methods that can be chained together to perform operations on iterators in a more readable and functional way. This feature makes working with iterators more convenient and expressive.
2822
+
2823
+
```javascript
2824
+
// Create a generator function
2825
+
function*generateNumbers() {
2826
+
yield1;
2827
+
yield2;
2828
+
yield3;
2829
+
yield4;
2830
+
yield5;
2831
+
}
2832
+
2833
+
// Use iterator helpers to transform the values
2834
+
constresult=generateNumbers()[Symbol.iterator]()
2835
+
.filter(x=> x >1) // Keep only values greater than 1
2836
+
.map(x=> x *10) // Multiply each value by 10
2837
+
.take(3) // Take only the first 3 values
2838
+
.toArray(); // Convert to an array
2839
+
2840
+
console.log(result); // [20, 30, 40]
2841
+
```
2842
+
2843
+
The new Iterator Helper methods include:
2844
+
2845
+
1. **Iterator.prototype.map()**: Maps each value in the iterator to a new value.
2846
+
2. **Iterator.prototype.filter()**: Filters values in the iterator based on a predicate.
2847
+
3. **Iterator.prototype.take()**: Takes a specified number of values from the iterator.
2848
+
4. **Iterator.prototype.drop()**: Skips a specified number of values from the iterator.
2849
+
5. **Iterator.prototype.flatMap()**: Maps each value and flattens the result.
2850
+
6. **Iterator.prototype.reduce()**: Reduces the iterator to a single value.
2851
+
7. **Iterator.prototype.toArray()**: Converts the iterator to an array.
2852
+
8. **Iterator.prototype.forEach()**: Executes a function for each value in the iterator.
2853
+
9. **Iterator.prototype.some()**: Checks if some values satisfy a condition.
2854
+
10. **Iterator.prototype.every()**: Checks if all values satisfy a condition.
2855
+
2856
+
Iterator Helpers are particularly useful for processing streams of data in a memory-efficient way:
2857
+
2858
+
```javascript
2859
+
function*generateUserData() {
2860
+
yield { id:1, name:"Alice", age:25 };
2861
+
yield { id:2, name:"Bob", age:30 };
2862
+
yield { id:3, name:"Charlie", age:35 };
2863
+
yield { id:4, name:"Dave", age:40 };
2864
+
}
2865
+
2866
+
// Find users over 30, extract their names, and take the first 2
The Temporal API is a new date and time API for JavaScript that addresses many of the limitations of the existing Date object. It provides a modern, immutable, and more intuitive way to work with dates and times.
ES2025 enhances JavaScript decorators by allowing them to associate metadata with decorated elements. This provides a standard way to attach and retrieve metadata for classes, methods, and properties.
0 commit comments