You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/05-data-types/05-array-methods/9-shuffle/task.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
-
importance: 3
1
+
важность: 3
2
2
3
3
---
4
4
5
-
# Shuffle an array
5
+
# Перемешайте массив
6
6
7
-
Write the function `shuffle(array)` that shuffles (randomly reorders) elements of the array.
7
+
Напишите функцию `shuffle(array)`, которая перемешивает (переупорядочивает случайным образом) элементы массива.
8
8
9
-
Multiple runs of`shuffle`may lead to different orders of elements. For instance:
9
+
Многократные прогоны через`shuffle`могут привести к разным последовательностям элементов. Например:
10
10
11
11
```js
12
12
let arr = [1, 2, 3];
@@ -22,4 +22,4 @@ shuffle(arr);
22
22
// ...
23
23
```
24
24
25
-
All element orders should have an equal probability. For instance, `[1,2,3]`can be reordered as`[1,2,3]` or`[1,3,2]` or`[3,1,2]`etc, with equal probability of each case.
25
+
Все последовательности элементов должны иметь одинаковую вероятность. Например, `[1,2,3]`может быть переупорядочено как`[1,2,3]`, или`[1,3,2]`, или`[3,1,2]`и т.д., с равной вероятностью каждого случая.
0 commit comments