JSFiddle - React, Tailwind, and code Playground

JavaScript

//Example 1:
//Using strings in the decision control structure
var someString = "" //String data type
if(someString ){  //valid
      alert('Inside string if')
}

//Example 2 :
//Using string variable which has non blank string as value
var stringValue = "js-gotcha";
if(stringValue){
     alert('Inside stringValue ')
}

//Example 3 :
var obj= {};
if(obj){
     alert('Inside obj with value');
}