Ruby Tutorial

Ruby Functions

Functions

Functions group reusable logic behind a name you can call anywhere.

def greet(name)
  "Hello, #{name}"
end
Try it Yourself
Run this RUBY example in your local environment or course sandbox.