What is @babel/plugin-transform-nullish-coalescing-operator?
The @babel/plugin-transform-nullish-coalescing-operator package allows Babel to transform nullish coalescing operator (??) syntax into equivalent JavaScript code that can run in environments that do not support this operator. The nullish coalescing operator is a logical operator that returns its right-hand side operand when its left-hand side operand is null or undefined, and otherwise returns its left-hand side operand.
Transform nullish coalescing operator
This feature transforms the nullish coalescing operator (??) into equivalent JavaScript code. In this example, if 'foo' is null or undefined, 'bar' will be set to 'default value'. Otherwise, 'bar' will be set to the value of 'foo'.
const foo = null;\nconst bar = foo ?? 'default value';