7_立即执行函数.html 592 B

123456789101112131415161718192021222324252627282930
  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. // 匿名函数
  11. // setTimeout(function(){
  12. // console.log(111)
  13. // },1000)
  14. // oBox.onclick = function(){
  15. // console.log(222)
  16. // }
  17. // var fn = function(){
  18. // console.log(111)
  19. // }
  20. // fn();
  21. (function(){
  22. console.log("123");
  23. })();
  24. </script>
  25. </body>
  26. </html>