js声明式函数提升问题

声明式函数是整体提升

   fn();
   function fn(){
       console.log("hello");
   };
   fn();

执行过程如下:

   function fn(){
       console.log("hello");
   };

   fn();

   fn();

猜你喜欢

转载自www.cnblogs.com/cupid10/p/12793196.html
今日推荐