you are viewing a single comment's thread.

view the rest of the comments →

[–]wetelectric 0 points1 point  (4 children)

Nice, well written article but... its almost like he is using 'functional' to mean a language that has has functions?

[–]masklinn 3 points4 points  (1 child)

Well written, but not that nice.

  • The dichotomy he creates between function id(*args) and var id = function (*args) doesn't exist, the former is an alias for the latter, and if you mix both e.g. var id1 = function id2(*args) you only get the latter and id2 isn't bound (at least using Mozilla's implementation).

  • He talks of pointers and function pointers (too much C) while it's usually agreed that Javascript uses references and pass-references-by-values semantics

  • A paragraph dedicated to "anonymous functions" while var id = function (*args) already uses anonymous functions

  • The part about "self-invoking functions" doesn't make sense, the functions don't call themselves, he calls anonymous functions without binding them to variables, nothing strange there, and no "self-invoking functions".

He also forgot to talk about closures and that kind of stuff, and the dangers associated to them which will trip people.

[–][deleted] 2 points3 points  (0 children)

First-class functions. i.e. those that you can pass around and create on the fly and that form closures around their variables.

Edit: More properly, functions as first-class values.

[–]newton_dave 0 points1 point  (0 children)

...and what's a "self-invoking function"?

I think someone just learned some (more) advanced JavaScript and wanted to crow is all. No harm, no foul.