有没有办法停止从另一个函数执行被调用的函数?
我有以下代码: -
function MainFunction() { //a long code that runs for few time };
MainFuntion();
<button onclick="(Here I want some thing to stop MainFunction())">Stop the running script </button>
Run Code Online (Sandbox Code Playgroud)
所以基本的想法是回归; 另一个函数的函数