Skip to content

Conversation

@SusanWendt
Copy link

No description provided.


def fetch_the_dog(input)
#implement your solution here
input.detect {|animal| animal == "dog"}.split
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this return ["d", "o", "g"]? I think we're expecting ["dog"] here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. My guess was wrong. I checked this irb:

irb> "dog".split
#=> ["dog"]

Anywho ... there's another method instead of detect that would return ["dog"] directly. That usage of split surprises me.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants