Advertisement
kstoyanov

01. Reveal Words

Jul 17th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(words, text) {
  2.   const arrWord = words.split(', ');
  3.  
  4.   arrWord.forEach((word) => {
  5.     const temp = '*'.repeat(word.length);
  6.     text = text.replace(temp, word);
  7.   });
  8.  
  9.   console.log(text);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement