Array

.include?

[1,2,3].include?(1)
#> true

.inject

[1,2,3].inject([]){|result, n| result.push({name: n})}
# [{:name=>1}, {:name=>2}, {:name=>3}]

*splat operator (Asterisk Operator)

turns an array into a bare list

Reference

results matching ""

    No results matching ""