3 ms·
Flattening an array is trivial in Ruby: [[1, 2, 3], 4, 5].flatten() I don't see how it could possibly be made easier or more intuitive than a single functio
by reality_czech 13y ago
Flattening an array is trivial in Ruby:
[[1, 2, 3], 4, 5].flatten()
I don't see how it could possibly be made easier or more intuitive than a single function call. Ruby also makes it clear what is going on.
- __david__ 13y agoThat flattens everything. In Perl it's trivial to flatten just the parts you need to and leave other nestings intact.