Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function revealWords(template, text) {
- let words = template.split(', ')
- for (let word of words) {
- text = text.replace('*'.repeat(word.length), word)
- }
- console.log(text)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement