Skip to content

Instantly share code, notes, and snippets.

@lucasm-iRonin
Created June 28, 2017 06:00
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 lucasm-iRonin/fee3af8057a114f51ac0992a18b651d0 to your computer and use it in GitHub Desktop.
Save lucasm-iRonin/fee3af8057a114f51ac0992a18b651d0 to your computer and use it in GitHub Desktop.
What will be printed by the last line (`puts` method), please explain the result:
def change_string(str)
str << "bbb"
str << "ccc"
str = "ddd"
end
test = "aaa"
change_string(test)
puts test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment