JSFiddle - React, Tailwind, and code Playground
JavaScript
var i;
if (i) {
alert('True. Type of i: ' + typeof i);
} else {
alert('False. Type of i: ' + typeof i);
}
var j = 0 // аналогично '', false, null;
if (j) {
alert('True. Type of j: ' + typeof j);
} else {
alert('False. Type of j: ' + typeof j);
}