Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hello, how can I implement a complete stop of the script so that, under some condition, the script is not interrupted, not paused, namely, it stops working (I take into account that the script is launched once, without using Autorefresh). The script is not cyclical, a full stop could happen at any moment of the script execution.
Solved! Go to Solution.
What is the actual use case?
It is very rare that you would just 'stop' a script.
Often you would use if/then/else statements (perhaps with some properties to see which way execution should go)
or if you are doing a loop you would use 'break'
What is the actual use case?
It is very rare that you would just 'stop' a script.
Often you would use if/then/else statements (perhaps with some properties to see which way execution should go)
or if you are doing a loop you would use 'break'
You can use a self executing function to encapsule you whole service and then use a return statement to stop it whenever you want.
const result = (function() {
// Your service code
})();
Or if you prefer the arrow notation:
const result = (() => {
// Your service code
})();