Question: JAVASCRIPT PLZ Write a Function named anagram that takes two arguments: a word and an array of words. Your function should return an array that

JAVASCRIPT PLZ

Write a Function named anagram that takes two arguments: a word and an array of words. Your function should return an array that contains all the words from the array argument that are anagrams of the word argument. For example, given the word "listen" and an array of candidate words like "enlist", "google", "inlets", and "banana", the program should return an array that contains "enlist" and "inlets".

EXAMPLE:

anagram('listen', ['enlists', 'google', 'inlets', 'banana']); // [ "inlets" ] anagram('listen', ['enlist', 'google', 'inlets', 'banana']); // [ "enlist", "inlets" ]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!