JSFiddle - React, Tailwind, and code Playground
HTML
<p>The value of a is <input id="a"/></p>
<p>The value of b is <input id="b"/></p>
JavaScript
var a = 'bob' || 'carol';
console.log(a); // 'bob'
document.getElementById('a').value = a;
var b = null || 'default';
console.log(b); // 'default'
document.getElementById('b').value = b;