Created
March 17, 2013 02:12
-
-
Save Denommus/5179244 to your computer and use it in GitHub Desktop.
An example of a Closure in Ruby, using code block
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
x = 5 | |
[1, 2, 3, 4].map { |y| y + x } # returns [6, 7, 8, 9] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment