Skip to content

Instantly share code, notes, and snippets.

@bertomartin
Forked from Bodacious/inject.rb
Created February 8, 2013 19:24
Show Gist options
  • Save bertomartin/4741296 to your computer and use it in GitHub Desktop.
Save bertomartin/4741296 to your computer and use it in GitHub Desktop.
string = ["b", "c", "d"].inject("a") { |result, element| result + element }
puts string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment