JS does not have PHP EXIT, nor Java's Return.
If the JS code is not a function, there is only one way when the JS execution needs to be suspended, that is:
document.location.href = YOUR_URL;
In addition, although ThROW can be suspended, it is still a non -friendly error message. Therefore, if you want to suspend your friendship, you can only be the above methods.
Therefore, the code of non -function mode cannot be suspended on the current page.