12 Tweets 2 reads Mar 29, 2023
1. Array.prototype.flat() and Array.prototype.flatMap()
flat() and flatMap() are array methods that flatten nested arrays. flat() flattens the array, while flatMap() applies a function and then flattens the result.
2. Object.fromEntries()
Object.fromEntries() creates an object from an array of key-value pairs, which is the reverse of Object.entries().
3. String.prototype.trimStart() and String.prototype.trimEnd()
trimStart() and trimEnd() are string methods that remove whitespace from the beginning or end of a string, respectively.
ES11 (ECMAScript 2020) Features
1. Nullish Coalescing Operator
The nullish coalescing operator (??) returns the right-hand operand if the left-hand operand is null or undefined, otherwise, it returns the left-hand operand.
2. Optional Chaining
Optional chaining (?.) allows you to access properties of an object without having to check for the existence of the object.
3. BigInt
BigInt is a new numeric type that can represent integers of arbitrary size.
ES12 (ECMAScript 2021) Features
1. Logical Assignment Operators
Logical assignment operators combine logical operators with assignment, making the code more concise.
2. Numeric Separators
Numeric separators (_) allow you to make large numbers more readable by separating groups of digits.
That covers most of the essential features introduced in modern JavaScript from ES6 to ES12.
By understanding and mastering these features, you’ll be well-equipped to write clean, efficient, and maintainable JavaScript code.
That's a wrap!
If you enjoyed this thread:
1. Follow us @codedamncom for more of these.
2. Retweet the first tweet above to share with your friends.

Loading suggestions...