This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.

Smartphone icons created by Freepik - Flaticon

JS Operators

The ?? Operator

The ?? operator returns the first argument if it is not nullish (null or undefined). Otherwise it returns the second.

let name = null;
let text = "missing";
let result = name ?? text;
document.getElementById("demo").innerHTML = "The name is " + result;