Help - interrupt self calling function

I use a self calling function on a page to cycle through all the items displayed in a ionic list.

     playword(){
          this.audio.playfile(this.wordData[this.playPosition]).then(data => {
               this.playPosition++;
               if (this.playPosition < this.wordData.length) this.playword();
          });
     }

It works fine - the only problem is I cannot find a way for the user to break the loop - I did link a button to call the following on the page:

     stopAuto(){
          this.playPosition = this.wordData.length;
     }

The problem is that whilst the self calling function is running it stop other calls being made.

Can anyone suggest a solution?

As written, I think this is impossible. Every iteration is queued up immediately, so there is no way to break the chain. I think you are going to have to set up a manual flag like aborted and add an if (this.aborted) { return } to the top of playword().

Thank rapropos, I think you are right about it being impossible, thankfully the arrays only have about 20 records in them so the loop does not take that long to play.