Skip to content

Instantly share code, notes, and snippets.

@maddox
Created July 30, 2008 19:34
Show Gist options
  • Save maddox/3309 to your computer and use it in GitHub Desktop.
Save maddox/3309 to your computer and use it in GitHub Desktop.
ar = [1, 4, 3, 10]
puts ar.inject(0) {|i, count| count += i }
=> 18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment