Skip to content

Instantly share code, notes, and snippets.

@quetzaluz
Created June 9, 2020 14:34
Show Gist options
  • Save quetzaluz/26184252c87bc8c729ba928943cabcca to your computer and use it in GitHub Desktop.
Save quetzaluz/26184252c87bc8c729ba928943cabcca to your computer and use it in GitHub Desktop.

Back to School Shopping Live Interview problems

Welcome to the live interview! We'll be taking this problem set and working on a few additional problems.

Prompt 1 - Find Items

You want to know which items are of the same type. Create a function called findItems that takes the array of items and a type of item as parameters and returns an array of item names.

findItems(items, "book") //=> [ 'Effective Programming Habits', 'Finding Your Center' ]

Prompt 2 - Find Items - Extended

Add the following feature to your Find Items function:

If the type of item to find does not show up in the list of items, return a message that says, No items found of that type. Please search for a different item.

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