Add /g to replace multiple spaces.

This commit is contained in:
Ceda EI 2020-04-23 20:33:48 +05:30
parent af56ffbbb3
commit 53dda834f9
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ function expand(words, text) {
const word = wordsWithLetter[Math.floor(Math.random() * wordsWithLetter.length)];
return word;
}).reduce((acc, cur) => acc + " " + cur).replace(/\s{2,}/, " ");
}).reduce((acc, cur) => acc + " " + cur).replace(/\s{2,}/g, " ");
}