Skip to content

Instantly share code, notes, and snippets.

@gabrie30
Last active August 29, 2015 14:06
Show Gist options
  • Save gabrie30/35b75c9a19f4bc889c81 to your computer and use it in GitHub Desktop.
Save gabrie30/35b75c9a19f4bc889c81 to your computer and use it in GitHub Desktop.
# I interpret animal[0] to be the entire word "snake"
# Why does this return anything, since s!= sname?
array = ["snake", "rat", "cat", "dog","salamandor"]
array.each do |animal|
puts animal if animal[0] == "s"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment