Monday, July 4, 2022
HomeITECMAScript 2022 blesses class components, top-level await

ECMAScript 2022 blesses class components, top-level await


ECMAScript 2022, the following replace to the official normal behind JavaScript, has been formally authorised, with new capabilities starting from class components to a top-level await functionality.

The ECMAScript 2022 specification was authorised by ECMA Worldwide on June 22. However the options already can be found in most browsers, stated Robert Palmer, co-chair of the TC39 committee that shepherds the usual, in March. Function availability in JavaScript engines is extra related to builders than look within the precise specification, Palmer stated.

ECMAScript 2022 has the next new options:

  • High-level await, permitting the await key phrase for use on the prime stage of modules.
  • New class components, together with private and non-private occasion fields, private and non-private static fields, and personal occasion strategies and accessors.
  • Static blocks inside courses, to carry out per-class analysis initialization.
  • The #x in obj#x in obj syntax, to check for the presence of personal fields on objects.
  • Common expression match indices through the /d/d flag, which provides begin and finish indices for matched substrings.
  • The trigger property on Error objects, for use to file a causation chain in errors.
  • The at technique for Strings, Arrays, and TypedArrays, permitting for relative indexing and to be used of Object.hasOwn, a substitute for Object.prototype.hasOwnProperty.

Final June’s ECMAScript 2021 standardized capabilities reminiscent of String.prototype.ReplaceAll, for changing cases of a substring, and the AggregateError error kind.

Copyright © 2022 IDG Communications, Inc.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments