2 ms·
With ruby 3.4 (prior to that `_1` should be used instead of `it`): (0..10).select{it.even?}
by psychoslave 2y ago
With ruby 3.4 (prior to that `_1` should be used instead of `it`):
(0..10).select{it.even?}
- psychoslave 2y agoAlso not that the result is `[0, 2, 4, 6, 8, 10]`, unlike the behavior of Python which exclude the value explicitely passed in parameter from the represented range.