Keyboard Row Lab
In this lab, you will be working with a function called
findWords(). This function takes an array of strings
words as input and returns the words that can be typed using letters of the alphabet on only one row of the American keyboard.
In the American keyboard:
- the first row consists of the characters
- the second row consists of the characters
- the third row consists of the characters
Your task is to implement the
findWords() function using the provided initial code in
index.js and pass the challenges given below. Your code will be evaluated based on these challenges, so make sure to carefully read and understand the requirements of each challenge.
findWords(["Hello", "Alaska", "Dad", "Peace"]); // Output: ["Alaska", "Dad"] findWords(["omk"]); // Output:  findWords(["adsdf", "sfd"]); // Output: ["adsdf", "sfd"]
1 <= words.length <= 20
1 <= words[i].length <= 100
words[i]consists of English letters (both lowercase and uppercase).
- Export the
findWordsfunction correctly from your
- Implement the
findWords()function that passes the given test cases.
- Make sure your code is bug-free and handles edge cases properly.
- Make sure you're exporting the default function