3 ms·
If anyone's confused by the 4 "puzzles," I whipped up a JSBin to demonstrate: http://jsbin.com/tuqukakawo/1/edit?js,console,output http://jsbin.com/tuqukakawo/1
by nolanl 11y ago
If anyone's confused by the 4 "puzzles," I whipped up a JSBin to demonstrate: http://jsbin.com/tuqukakawo/1/edit?js,console,output http://jsbin.com/tuqukakawo/1/edit?js,console,output
- eevilspock 11y agoWhat if the doSomethingElse in #3 returns a function that is equivalent to the doSomethingElse of #1? Shouldn't #3 then be identical to #1?
- nolanl 11y agoYes, but in most code I've seen, that's a typo rather than someone intentionally writing a function that returns a function. You can definitely do it!