Skip to content

Instantly share code, notes, and snippets.

@rwdaigle
Created August 9, 2016 23:40
Show Gist options
  • Save rwdaigle/05f4700f2fef81abda61ea76f41b201b to your computer and use it in GitHub Desktop.
Save rwdaigle/05f4700f2fef81abda61ea76f41b201b to your computer and use it in GitHub Desktop.
class Array
def odds
odds = []
each_with_index do |val, index|
odds << val if index % 2 == 1
end
odds
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment