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