Skip to content

Commit a6aec77

Browse files
authored
Update task.md
1 parent 43a6f7d commit a6aec77

File tree

1 file changed

+4
-5
lines changed
  • 1-js/05-data-types/05-array-methods/9-shuffle

1 file changed

+4
-5
lines changed

1-js/05-data-types/05-array-methods/9-shuffle/task.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ importance: 3
22

33
---
44

5-
# 随机排序
5+
# 随机排列数组
66

7-
编写函数 `shuffle(array)` 混洗(随机重新排序)数组的元素
7+
编写函数 `shuffle(array)` 来随机排列数组的元素
88

9-
多次运行 `shuffle` 可以导致不同的元素顺序。例如:
9+
多次运行 `shuffle` 可能导致元素顺序的不同。例如:
1010

1111
```js
1212
let arr = [1, 2, 3];
@@ -22,5 +22,4 @@ shuffle(arr);
2222
// ...
2323
```
2424

25-
所有元素顺序应该具有相等的概率。例如,`[1,2,3]` 可以重新排序为 `[1,2,3]``[1,3,2]``[3,1,2]` 等。每种情况的概率相等。
26-
25+
所有元素顺序应该具有相等的概率。例如,可以将 `[1,2,3]` 重新排序为 `[1,2,3]``[1,3,2]``[3,1,2]` 等,每种情况的概率相等。

0 commit comments

Comments
 (0)