stop execution in javascript code example
Example 1: javascript stop execution
// EXAMPLE
throw new Error("This is your custom error message");
/*
SYNTAX
throw new Error("<your-custom-message>");
*/
Example 2: in javascipt how to stop further page processing
if(someEventHappened) return; // Will prevent subsequent code from being executed
alert("This alert will never be shown.");