In this example, We have a flag variable with true as its value.
flag
var flag= true; if(flag){ document.write("flag is true."); }
It will return "flag is true" statement.