/anagrams2

Primary LanguageJavaScript

Anagram Part II

This time you're going to check a word against a list of other words.

Premise

The goal of this exercise is to return a new list of all the anagrams from the provided list.

Example

anagrams_for("saltier", ["cognac", "saltier", "realist", "retails"]) == ["saltier", "realist", "retails"]

Challenge Yourself

  • Try to break your method up so that they only have a single job to do.