strange observation on IIFE in node.js (Windows)

后端 未结 2 1129
挽巷
挽巷 2021-01-15 02:28

Is the below behavior expected for nodejs? It looks buggy to me. If not what am I missing?

2条回答
  •  梦谈多话
    2021-01-15 03:31

    A missing semicolon is the cause of your issues.

    var abc = function(){
    console.log("hello");
    }; // missing semicolon!
    
    (function(){
      console.log("welcome");
    })();
    

提交回复
热议问题