Advertisement
Onesible

Untitled

Feb 27th, 2025
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function revealWords(template, text) {
  2.     let words = template.split(', ')
  3.  
  4.     for (let word of words) {
  5.         text = text.replace('*'.repeat(word.length), word)
  6.     }
  7.  
  8.     console.log(text)
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement