Eloquent JavaScript - Values Variables Control Flow
the || operator
HTML
<div id="output"></div>
JavaScript
var input = prompt("What is your name?", "");
document.getElementById("output").innerHTML = "Well, hello " + (input || "unknown") + "!";
// the || operator returns the first value, if the value is 'true'/has a value