Javascript Features Added in ES2021 Draft

News

The draft for ES2021 has been released, and it includes the below new Javascript features :

  • String.replaceAll() : A long awaited feature — finally replacing multiple substrings becomes very easy! Adding to the good news, all current browsers support this.
  • Promise.any() : Like the name suggests, this is basically an indicator when at least one of a set of promises is resolved.
  • Weak References : This is a data type for better memory management. Generally when there is a reference to an object, that object is not garbage collected (strong reference). With weak references, the object can still be garbage collected.
  • Logical Assignment Operators : This includes 3 new operators that will help to shorten down code.
  • Numeric Separators : This helps in improving the readability of really long numbers. For example, the number 99999999999999999 can be re-written using Numeric Separators as 99_999_999_999_999_999, which is far easier to read and less error-prone.

More Javascripr features may be included when the final ES2021 candidate is released.

Useful Resources

January 13, 2021

Comments

Loading Comments