JSFiddle - React, Tailwind, and code Playground

HTML

<div id="output"></div>

JavaScript

function log(x) {
    $("#output").append($("<p>").text(x));
}

var oneOrTheOther, someOtherVar;

someOtherVar = "not false";
oneOrTheOther = someOtherVar && "some string";
log("When someOtherVar is non-false, oneOrTheOther is "+oneOrTheOther.toString()+".");

someOtherVar = false;
oneOrTheOther = someOtherVar && "some string";
log("When someOtherVar is false, oneOrTheOther is "+oneOrTheOther.toString()+".");