3 ms·
From the blog post: "JavaScript's C-like syntax, including curly braces and the clunky for statement, makes it appear to be an ordinary procedural language. T
by jkush 19y ago
From the blog post:
"JavaScript's C-like syntax, including curly braces and the clunky for statement, makes it appear to be an ordinary procedural language. This is misleading because JavaScript has more in common with functional languages like Lisp or Scheme than with C or Java. It has arrays instead of lists and objects instead of property lists. Functions are first class. It has closures. You get lambdas without having to balance all those parens."
Can anyone point to some good literature describing how one would go about writing Javascript in a functional style? I've seen some, none of which appear to be very practical.
- tuukkah 19y agoReading through Higher-Order JavaScript was practical for me at least: http://interglacial.com/hoj/hoj.html http://interglacial.com/hoj/hoj.html
- inklesspen 19y agoHave a look at some of Douglas Crockford's stuff. If you're familiar with The Little Schemer, The Little JavaScripter may be of particular interest. http://javascript.crockford.com/ http://javascript.crockford.com/
- jkush 19y agoHey, great link! Thanks.