Re:Writing Eloquent JavaScript Without CoffeeScript
by ryankshaw on Friday December 09, 2011 @01:41PM
(#3334926)
lol, after reading the article I came back in here to call out that exact same chunk of code and the exact same sad face. I will agree, however for small things the ternary operator is prettier than the if...then...else... syntax
thing[conditional ? 'show' : 'hide']();
instead of:
thing[if conditional then 'show' else 'hide']()