Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for javascript behaviour - function expression vs function declaration - difference

Current License: CC BY-SA 3.0

8 events
when toggle format what by license comment
Aug 14, 2018 at 10:05 vote accept manjeet
Mar 28, 2018 at 20:28 comment added Quentin @NinaScholz — There are (potentially) lots of scopes that are outside the function. It isn't available in any of them though.
Mar 28, 2018 at 20:27 history edited Quentin CC BY-SA 3.0
added 9 characters in body
Mar 28, 2018 at 20:26 comment added Rashad Saleh Maybe you should add a reference that explains the difference between function expressions and function declaration.
Mar 28, 2018 at 20:24 comment added Nina Scholz no, i mean the outside scope of the function. (the expression nature of the function, where it looks like an expression is a very good explanation.)
Mar 28, 2018 at 20:21 comment added Quentin @NinaScholz — Each function defines its own scope (and there is also the global scope). Named function expressions create a variable with the same name as the function inside themselves, which is useful for creating recursive functions. (In ES6 scope gets more complicated with the addition of block level scope to the language, but that's irrelevent here as only function scope is involved).
Mar 28, 2018 at 20:21 history edited Quentin CC BY-SA 3.0
added 9 characters in body
Mar 28, 2018 at 20:16 history answered Quentin CC BY-SA 3.0

AltStyle によって変換されたページ (->オリジナル) /