Skip to content
Advertisement

How can I shuffle the letters of a word?

What is the easiest way to shuffle the letters of a word which is in an array? I have some words in an array and I choose randomly a word but I also want to shuffle the letters of it.

JavaScript

I am not supposed to use that List thing. I’ve come up with something like this but with this code it prints random letters it doesn’t shuffle. Maybe I can code something like do not print if that letter already printed?

JavaScript

Advertisement

Answer

Really no need for collection and anything more than what follows:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement