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