JS hangs on a do while loop

后端 未结 6 1522
南旧
南旧 2020-12-20 07:40

I am wondering how I can solve a hanging page with JS.

I have a JS loop which I\'m testing like this, but it seems to hang forever - is there a way to stop it hangin

6条回答
  •  一个人的身影
    2020-12-20 08:20

    Tight loop is likely to always exhaust computing power. I would do it in chunks. Say, divide your list into smaller lists and pause 5ms in between lists. I can provide an example if you need.

提交回复
热议问题