translating
This commit is contained in:
parent
2b874a73be
commit
928cd2731b
165 changed files with 2046 additions and 2967 deletions
|
@ -2,17 +2,10 @@ importance: 3
|
|||
|
||||
---
|
||||
|
||||
# Получить случайное значение из массива
|
||||
# A random array value
|
||||
|
||||
Напишите код для вывода `alert` случайного значения из массива:
|
||||
Write the code to `alert` a random value from the array:
|
||||
|
||||
```js
|
||||
var arr = ["Яблоко", "Апельсин", "Груша", "Лимон"];
|
||||
let arr = ["Apple", "Orange", "Pear", "Lemon"];
|
||||
```
|
||||
|
||||
P.S. Код для генерации случайного целого от `min` to `max` включительно:
|
||||
|
||||
```js
|
||||
var rand = min + Math.floor(Math.random() * (max + 1 - min));
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue