Created
August 9, 2016 23:40
-
-
Save rwdaigle/05f4700f2fef81abda61ea76f41b201b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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