Js How To Prevent A Code From Runing Code Example

Snippet 1
  if(someEventHappened) return; // Will prevent subsequent code from being executed
alert("This alert will never be shown.");