Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(wordInput, text) {
- const isFind = text.toLowerCase()
- .split(' ')
- .filter((word) => word === wordInput);
- const findWord = isFind.join();
- if (findWord !== '') {
- console.log(findWord);
- } else {
- console.log(`${wordInput} not found!`);
- }
- }
Add Comment
Please, Sign In to add comment