4 ms·
Wow, the top answer really doesn't understand first class functions at all.
by river_styx 18y ago
Wow, the top answer really doesn't understand first class functions at all.
- bradgessler 18y agoYeah, that's a pretty bad example!
- ericwaller 18y agoThat may not be a particularly interesting example, but I don't think it's bad. var a = 5; var a = function() { alert('hello world'); }; var a = 2; It's not a closure (which is what I assume you were hoping for), but it definitely reveals something pretty unexpected about the language for someone who has no experience with first class functions.
- bradgessler 18y agoYeah, that's also pretty bad. It doesn't show what you can do with the function.
- johns 18y agoThen go post a comment on that answer or post a better answer. If you prove his answer wrong, it can be edited. It's a wiki as much as it is a Q&A site.
- vegashacker 18y agoI almost was inspired to, but it said something like comments require 50 points. I also don't know what I'd write. As a programmer, I feel crippled without first-class functions, but I'm not sure I know how to distill them into a few choice lines. My first instinct was to use something like map, but I don't think JS has such functions built-in.
- AndyKelley 18y ago"answers" don't require 50 points. In fact I don't think answers even require login.
- davidw 18y agoI found the whole "you can't do this, or that, or this other thing without points" kind of annoying.
- vegashacker 18y agoI too found it annoying, but it still might be a good idea. Maintaining quality of content is a big deal. Obviously you'll lose some good posts, but in the end it might be worth it.