函数调用函数自身,就叫递归

    1. <!DOCTYPE html>
    2. <html lang="en">
    3. <head>
    4. <meta charset="UTF-8">
    5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
    6. <title>Document</title>
    7. </head>
    8. <body>
    9. <script>
    10. function show(){
    11. // 函数调用函数自身,就叫递归
    12. setTimeout(function(){
    13. console.log(1)
    14. show();
    15. },1000)
    16. }
    17. show()
    18. </script>
    19. </body>
    20. </html>