Jason Lengstorf, vice president of developer experience at development platform Netlify, told The New Stack: “Companies are investing in advancing the language because it is a language that is broadly applicable to builders of the web. This explains why many organizations contributed to the language specification leading to his ES2022 release. I have.”
Lengstorf said Netlify was specifically focused on how this release could help them do more with their serverless and edge capabilities.
“There are some pretty big (and somewhat controversial) built-ins like top-level await. It’s a welcome addition to many developers, but some experts aren’t sure how it works. It’s seen as a footgun that trips developers who don’t know what the hood is,” Lengstorf said.
According to the ECMA 2022 language specification, the top-level await function “defers execution of the current and parent modules until the imported module is loaded.” Allows modules to determine dependencies using run-time values, and can be used as a fallback for dependencies, as per the standard.
Lengstorf says one thing he was happy to see was the .at() method, which is now supported on Array, String, or TypedArray. This supports negative indexing of JS arrays, which other programming languages already allow.it gives the ability to write arr[-1] instead of arr [arr.length-1]According to software engineer Brayan Arrieta’s blog, negative numbers count backwards from the last element.
Characteristics of error causes
Lengstorf also highlights the introduction of the “cause” of thrown errors, stating that it “provides more avenues for library authors to create great developer experiences.”
error.cause now allows developers to specify the error that caused the current exception using the Error object and its subclasses, according to web developer Kai Wenzel’s standard overview. The cause is shown in the stack trace and can be accessed via err.cause. change.
“One standout feature is Error.cause,” Kowal told The New Stack. “ES2022 adds idioms for expressing and checking sequential causality between errors, and complements his AggregateError, which expresses causality of parallel errors.”
Combined, these features “allow us to reflect the causality of errors,” he says, and will eventually show up in developer tools. Combined with the libraries they start using, “developers will be better able to glean useful information about the root cause of failures.” Kowal added.
User interface creation support
Part of the update will help developers speed up the creation of user interfaces and includes new “incredibly popular” UI widgets, said CEO of SEO firm Rank Secure. says one Baruch Labunski.
Also importantly, Labunski said the update addresses two broken libraries that had malicious packages in their original creation.
In the next iteration, Agoric wants support for compartments, said Kowal
“This is probably the most anticipated upcoming feature. Basically all the date formatting is done. For example, what does today’s date minus one month mean?” rice field. It has all sorts of complex date logic, not just formatting, but also date calculations.