https://mysteryweevil.medium.com/mastering-infinite-loops-in-javascript-a-practical-guide-9a7030b5aff6