Adopting new JavaScript syntax in Node.js 22
The formal specification for the JavaScript language is ECMAScript. New JavaScript features make their way into Node.js via updates to the underlying V8 JavaScript engine that the Node.js runtime is built on top of. ECMAScript has annual updates that provide new JavaScript language features and syntax.
New major versions of Node.js tend to include a significant upgrade to the V8 engine. Node.js version 22.0.0 was released with V8 version 12.4. However, the V8 version may be upgraded during the lifetime of Node.js 22.
Updated versions of V8 bring underlying performance improvements and new JavaScript language features and syntax to the Node.js runtime. This recipe will showcase a couple of the newer JavaScript language features that have been introduced in Node.js 22.
Getting ready
For this recipe, you will need to have Node.js 22 installed. You will also need to have access to a terminal.
How to do it…
In this recipe...