The nullish coalescing operator ?? is a way to handle these cases in a more concise way in source

let myName = null;
console.log(myName ?? "Anonymous"); // "Anonymous"
 
myName = "Lane";
console.log(myName ?? "Anonymous"); // "Lane"

If the value on the left of ?? is null or undefined, the value on the right is returned. Otherwise, the value on the left is returned. It’s a way to set sane defaults for variables that might be empty.