Javascript run a function inside a loop every x iterations

前端 未结 5 1450
借酒劲吻你
借酒劲吻你 2020-12-07 03:30

I have a variable of unknown value, it will be an integer. For this sake, lets say var a = 3;

I have a function that is called continuously:

<         


        
5条回答
  •  情深已故
    2020-12-07 04:30

    Instantiate a counter variable that increments every time anim() is called. When

    counter % a === 0
    

    Then you run this.appendEnd()

提交回复
热议问题