if (!(typeof worldHasEnded == "undefined")) { document.write("YUP."); } else { document.write("NOPE."); }