Skip to content

Instantly share code, notes, and snippets.

@jenny-codes
Created April 1, 2019 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jenny-codes/2d8c11eff334a9a54c281df277f08d12 to your computer and use it in GitHub Desktop.
Save jenny-codes/2d8c11eff334a9a54c281df277f08d12 to your computer and use it in GitHub Desktop.
def proc_return
Proc.new { return 'return from inside Proc' }.call
return 'return from proc function'
end
def lambda_return
lambda { return 'return from inside lambda' }.call
return 'return from lambda function'
end
puts proc_return
puts lambda_return
@jenny-codes
Copy link
Author

results

return from inside Proc
return from lambda function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment