The Lodash popular JavaScript library exported as a Gem for Ruby developers.
gem install rudash
require 'rudash'
double = ->(value) { value * 2 }
array = [1, 2, 3]
R_.map(array, double) # => [2,4,6]
is_even = ->(value) { value.even? }
array = [1, 2, 3, 4]
R_.filter(array, is_even) # => [2,4]
# You can also use inline anonymous function style
array = [1, 2, 3, 4]
R_.filter(array, ->(value) {
value.even?
}) # => [2,4]