In particular, I want to make sure to avoid the mistake made in Microsoft’s Browser Choice shuffle code. That is, I want to make sure that each letter has an equal probability of ending up in each possible position.
e.g. Given “ABCDEFG”, return something like “GEFBDCA”.
I modified an example from the Fisher-Yates Shuffle entry on Wikipedia to shuffle strings:
More information can be found in Jon Skeet’s answer to Is it correct to use JavaScript Array.sort() method for shuffling?.