3 ms·
Yeah, that's a pretty bad example!
by bradgessler 18y ago
Yeah, 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.