例如原代码是递归调用
      function c() {
        a()
      }
      function b() {
        c();
      }
      function a() {
        total++;
        console.log(total)
        if (total == 10000) {
          alert("success");
        }else{
          b();
        }
      }
      a();
当堆栈大于几万的时候就会导致爆栈
我们可以给改成迭代调用
      let total = 0;
      const arr = [];
      let active = false;
      function c() {
        funcRunner(() => a());
      }
      function b() {
        c();
      }
      function a() {
        total++;
        console.log(total)
        if (total == 10000) {
          alert("success");
        }else{
          b();
        }
      }
      a();
      function funcRunner(funx) {
        if (active) {
          arr.push(funx);
          return;
        }
        active = true;
        do {
          funx();
        } while ((funx = arr.shift()));
      }
让迭代器保存待执行的函数的应用
随即直接返回
即可让堆栈结束递归
然后funcRunner开始新一次的函数调用