Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(paramOne, paramTwo){
- let word = paramOne,
- pattern = new RegExp(`\\b${word}\\b`, 'i'),
- text = paramTwo.toLowerCase(),
- result = text.match(pattern);
- console.log(result !== null ? word : `${word} not found!`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement