Update solution.md
This commit is contained in:
parent
b202d616ec
commit
13719f808b
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ shuffle(arr);
|
||||||
alert(arr);
|
alert(arr);
|
||||||
```
|
```
|
||||||
|
|
||||||
That somewhat works, because `Math.random()-0.5` is a random number that may be positive or negative, so the sorting function reorders elements randomly.
|
That somewhat works, because `Math.random() - 0.5` is a random number that may be positive or negative, so the sorting function reorders elements randomly.
|
||||||
|
|
||||||
But because the sorting function is not meant to be used this way, not all permutations have the same probability.
|
But because the sorting function is not meant to be used this way, not all permutations have the same probability.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue