ram
12/10/2015 1:49:00 AM
Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>>Sorry, I can't help there. The general notion -- that of anonymous
>>>functions -- is found in many languages. If you knew, for example,
>>>Lisp, almost nothing in EcmaScript would be new to you, but you probably
>>>want a language specific reference, and I have not researched that.
>>»14.1 Function Definitions« gives the syntax for
>>»FunctionExpression« and says that a »FunctionExpression«
>>starts with the token »function«.
>Sure, but I did not think the OP wanted a reference to the language
>specification. I though they wanted some resource to learn about such
>usages. By "language specific reference" I meant something to learn
>about this style but using EcmaScript not, say, Lisp or ML.
Ah, I see!
I believe many JavaScript books and tutorials for beginners treat
function expression, albeit sometimes under a different name.
One can skim through the table of contents, the index,
or the pages of a book to get an impression before buying.
A modern book also would treat modern function expressions, like
x => x * x
, which are actually called »arrow functions« (14.2).
( x => x * x )( 2 )
4
I had to add parentheses there too, albeit for a different
reason.