0

I understand a javascript expression can be defined as "producing a value".

It seems the following is an expression:

function fun(){}//1

Because when enforcing the expression context with parentheses does not cause an error:

(function fun(){})//2

But then what is the value produced by the above expression (//1)?

balteo
  • 20,469
  • 52
  • 196
  • 362
  • log/alert it and you'll see – Banana Feb 06 '15 at 11:40
  • Find an explanation in this question. The value would be the function itself: http://stackoverflow.com/questions/336859/var-functionname-function-vs-function-functionname – Ramón Gil Moreno Feb 06 '15 at 11:43
  • @Banana Ummm... This is somewhat confusing because the above is called a "function declaration". Why then this function is an "expression"? – balteo Feb 06 '15 at 11:43
  • have a look [Here](http://stackoverflow.com/questions/2326072/javascript-function-pointer-assignment) – Banana Feb 06 '15 at 11:47

0 Answers0