Hacker News new | past | comments | ask | show | jobs | submit login

You can use "function" too.

There are 2 because JavaScript has 2 different structures for making functions; function expressions (which I chose "lambda" for) and function declarations (which I chose "function" for). See https://github.com/anko/eslisp/blob/master/doc/basics-refere... for examples.

Function declarations are statements, and you need to provide a name for the function.

Function expressions are expressions, and the name is optional.

In practice they often end up being interchangeable, but I just wanted to make sure any JavaScript is definitely representable.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: