According to Geeks for Geeks, over 72% of businesses are looking for JavaScript developers. As the language continues to evolve, it doesn’t seem like it will change anytime soon.
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.”
ECMAScript 2022, the latest release of JavaScript, had 8 updates in June. The New Stack asked developers to share their most significant changes.
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.
“It’s a bit of an ergonomic enhancement to the JavaScript syntax,” says Lengstorf.
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.”
Kris Kowal, Software Engineer at Agoric, also cites Error.cause functionality as a key upgrade. Agoric is a JavaScript native smart contract platform and Proof of Stake blockchain.
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.
“Error.cause represents one of the best ways for JavaScript to evolve, making it more complete by filling in the blanks implied by the existence of other features,” he said. .
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.
“One change was to allow people using AngularJS to migrate to Angular, as AngularJS is no longer supported,” said Labunski. “Other popular shows have been updated as well. Part of the update supports Microsoft adding type syntax to JavaScript, helping programmers add type annotations to his JS code. because it does.”
Also importantly, Labunski said the update addresses two broken libraries that had malicious packages in their original creation.
what’s next?
Agoric participates in the ECMAScript table through Mark Miller, Agoric’s CTO and Chief Scientist, who has been a member of the ECMAScript Standards Group since the mid-1990s when he joined as a representative of Google. (See our upcoming interview with Miller on how E helped shape his JavaScript.) Agoric uses a version of his JavaScript that has been enhanced with blockchain solutions.
In the next iteration, Agoric wants support for compartments, said Kowal
“We are excited to share more Hardened JavaScript features that allow first-class Modules and ModuleSources to appear in the language and allow guest programs to safely invite and run in shared areas,” he said.
Developer Shawn Wang (aka @swyx) has documented the evolution of JavaScript and claims that JavaScript is in its third era. One of the changes he’s looking forward to is a tentative proposal in the third phase of a four-step proposal process.
“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.
Despite criticisms of the language, JavaScript seems to be here to stay for the time being.
“Yes, it has bugs, but it works,” Wang told The New Stack. “Running everywhere. This is a very big advantage to overcome. … yes, if you have a domain-specific language [a] certain new platforms and devices on which nothing else runs, [then] Sure, you can create your own language. But beyond that, JavaScript does it all. ”