Created
December 28, 2018 08:32
-
-
Save 3014zhangshuo/f15b126370bea660522df9e1d9ec73b8 to your computer and use it in GitHub Desktop.
anonymous function example in ruby and javascript
This file contains hidden or 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
var sum = function (a, b) { | |
return a + b; | |
} |
This file contains hidden or 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
sum = Proc.new { |a, b| a + b } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment