[Vuejs]-Scramble per letter using javascript

0👍

You can pass the replacement as a function instead of single string which will invoke for each match.

...
  texts[name] = text.replace(
    /./g,
    () => characters.charAt(Math.floor(Math.random() * charactersLength))
  )
...

Leave a comment