Tuesday, 10 September 2013

Why can we subsitute "foo" for "function (x) { return foo(x); }"

Why can we subsitute "foo" for "function (x) { return foo(x); }"

I was looking for lesser knows facts about JavaScript and I came across
this piece, can anyone explain why the below code
function (x) { return foo(x); }
can be substituted with
foo
Tried to figure this out with the little knowledge of JavaScript which I
had, but I didn't find the reason. Can anyone explain it?

No comments:

Post a Comment