This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.
Smartphone icons created by Freepik - Flaticon
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;