Created
March 6, 2016 22:36
-
-
Save randallreedjr/4c436cbf8c19cf05aba7 to your computer and use it in GitHub Desktop.
Fifth code sample for post Ruby Abstraction in Loops
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
array = [1,2,3] | |
array.collect do |element| | |
element ** 2 | |
end | |
# => [1,4,9] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment