Skip to content

Instantly share code, notes, and snippets.

@trivektor
Created June 19, 2011 18:57
Show Gist options
  • Save trivektor/1034602 to your computer and use it in GitHub Desktop.
Save trivektor/1034602 to your computer and use it in GitHub Desktop.
Sum array
array.inject{|sum,x| sum + x }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment