Nullish coalescing operator (??)

It returns its right-hand side operand when its left-hand side operand is null or undefined, and otherwise returns its left-hand side operand.

Good to set up backup value in case of invalid main value.

const foo = null ?? 'default string';
console.log(foo);
// expected output: "default string"

const baz = 0 ?? 42;
console.log(baz);
// expected output: 0

The empty string is NOT considered a falsy value by ??, thus it will not return the second argument
let myText = ''; // An empty string (which is also a falsy value)

let notFalsyText = myText || 'Hello world'; 
console.log(notFalsyText); // Hello world, because for logical || empty value is falsy

let preservingFalsy = myText ?? 'Hi neighborhood';
console.log(preservingFalsy); // '' (as myText is neither undefined nor null)