3 ms·
For the toy example, sure. But as soon as the example gets at all more complicated, you'll need to throw the function(it){} back in. Also, it's worthwhile to r
by andreyf 17y ago
For the toy example, sure. But as soon as the example gets at all more complicated, you'll need to throw the function(it){} back in.
Also, it's worthwhile to remember that aif does a bit more - it's semantically the equivalent of cond, which sometimes eliminates a ton of if/else blub.
- latortuga 17y agohttps://developer.mozilla.org/en/New_in_JavaScript_1.8#Expression_closures https://developer.mozilla.org/en/New_in_JavaScript_1.8#Expre... New in 1.8 you can omit the return and curly braces. So at least a little improvement!