Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
array = [1, 2, 3]
puts [1, 1, 1].inject(array) {|sum_array, a| sum_array << a}
# [1, 1, 1, 1, 2, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment