Skip to content

Instantly share code, notes, and snippets.

@damianesteban
Created June 25, 2014 17:06
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 damianesteban/f596375cb80bc11fa552 to your computer and use it in GitHub Desktop.
Save damianesteban/f596375cb80bc11fa552 to your computer and use it in GitHub Desktop.
Arrays and Strings
array = ["Ruby", "Pascal", "Smalltalk", "io"]
# And then we want to return the value at Index 1:
array[1]
# vs.
puts array[1]
# Strictly speaking. is the puts method returning the value
# at Index 1, or is it returning the string representation
# of the value at Index 1? On top of that, the value at
# Index 1 is a string already, so does it really matter?
@kotp
Copy link

kotp commented Jun 26, 2014

puts always returns nil. Or at least Kernel#puts always returns nil.

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