3 ms·
Just as an aside about your Ruby example: (condition && string).to_s (string if condition).to_s both work (though the first fails when passed false i
by derefr 19y ago
Just as an aside about your Ruby example:
(condition && string).to_s
(string if condition).to_s
both work (though the first fails when passed false instead of nil.) I use something similar in quick-and-dirty Ruby shell scripts:
n_to_generate = (ARGV.shift || "0").to_i