What are reasons for the debouncing function implemented in recursion instead of iteration?
<p>In this post we have a snippet of debouncing function:
<a href="https://stackoverflow.com/questions/24004791/can-someone-explain-the-debounce-function-in-javascript">Can someone explain the &quot;debounce&quot; function in Javascript</a></p>

<p>It uses recursion as the algorithm. However, this doesn't seem to fit the typical recursion situation, where each step has a somewhat <strong><em>smaller</em></strong> instance of the previous step. I was wondering if there are any advantage using recursion at all? To me, this method would inevitably burden call stacks by recursive calls. Could someone list some reasons backing up this recursive approach? Thanks.</p>