Function names defined as parameters to a function call aren't hoisted. Why not?

前端 未结 3 1920
灰色年华
灰色年华 2021-01-19 03:52

Consider the following code.



Notice that a

3条回答
  •  既然无缘
    2021-01-19 04:46

    Inside a(function b() {});, the function is a function expression and not a function declaration (only which are hoisted). You might have a look at var functionName = function() {} vs function functionName() {} for the difference.

提交回复
热议问题