[JS] Add hoist link to function declaration/expression section (#182)
* Add link to browser matching CSS selector section * Add link to pseudo selector in float section * Add hoist link to function declaration/expression section
This commit is contained in:
parent
4d152f389e
commit
28dee15c8a
|
|
@ -892,7 +892,7 @@ If you haven't already checked out Philip Robert's [talk on the Event Loop](http
|
|||
|
||||
### Explain the differences on the usage of `foo` between `function foo() {}` and `var foo = function() {}`
|
||||
|
||||
The former is a function declaration while the latter is a function expression. The key difference is that function declarations have its body hoisted but the bodies of function expressions are not (they have the same hoisting behavior as variables). For more explanation on hoisting, refer to the question above on hoisting. If you try to invoke a function expression before it is defined, you will get an `Uncaught TypeError: XXX is not a function` error.
|
||||
The former is a function declaration while the latter is a function expression. The key difference is that function declarations have its body hoisted but the bodies of function expressions are not (they have the same hoisting behavior as variables). For more explanation on hoisting, refer to the question above [on hoisting](#explain-hoisting). If you try to invoke a function expression before it is defined, you will get an `Uncaught TypeError: XXX is not a function` error.
|
||||
|
||||
**Function Declaration**
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue