Constants cannot be defined in methods

suggest change
def say_hi
  MESSAGE = "Hello"
  puts MESSAGE
end

The above code results in an error: SyntaxError: (irb):2: dynamic constant assignment.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents