Good stuff. Here are my notes on your code:
- Your anagrams? method is sweet. You got this one 100%.
- You chose to use map to iterate through each word in
list_arr
. This works, but it is a misuse ofmap
. Why? Becausemap
has a specific function: to iterate through an existing array, perform the same action on each object in the existing array, and return a new array that contains the resulting objects. Since you do not need to do this in yourfind_anagrams
method,map
is not a good choice. - BUT, your logic is sound. You are iterating through the
list_arr
, checking each objec