Skip to main content
Tags go in Tags box, not title
Link
Heretic Monkey
  • 12.2k
  • 7
  • 63
  • 133

javascript - How to repeat random string with .repeat() and make it still random?

Source Link
Miskakao
  • 99
  • 1
  • 7

javascript - How to repeat random string with .repeat() and make it still random?

Is there some way to make random strings with .repeat() still random? If I use this:

console.log(`${Math.random()} | `.repeat(5)); 

the output is something like this:

0.2564646392254777 | 0.2564646392254777 | 0.2564646392254777 | 0.2564646392254777 | 0.2564646392254777 | 

In a nutshell, the output is the same.