Advertisement
nikolayneykov

Untitled

Mar 24th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(paramOne, paramTwo){
  2.     let word = paramOne,
  3.         pattern = new RegExp(`\\b${word}\\b`, 'i'),
  4.         text = paramTwo.toLowerCase(),
  5.         result = text.match(pattern);
  6.        
  7.         console.log(result !== null ? word : `${word} not found!`);
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement