Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function revealWords(words, templates) {
- words = words.split(', ');
- templates = templates.split(' ');
- for (let word of words) {
- for (let index in templates) {
- if (templates[index] === '*'.repeat(word.length)) {
- templates[index] = word;
- }
- }
- }
- let output = templates.join(' ');
- console.log(output);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement