translating

This commit is contained in:
Ilya Kantor 2016-03-21 10:16:55 +03:00
parent 2b874a73be
commit 928cd2731b
165 changed files with 2046 additions and 2967 deletions

View file

@ -1,10 +1,10 @@
```js run
var styles = ["Джаз", "Блюз"];
styles.push("Рок-н-Ролл");
styles[styles.length - 2] = "Классика";
let styles = ["Jazz", "Blues"];
styles.push("Rock-n-Roll");
styles[(styles.length + 1) / 2] = "Classics";
alert( styles.shift() );
styles.unshift("Рэп", "Регги ");
styles.unshift("Rap", "Reggie");
```

View file

@ -2,23 +2,23 @@ importance: 5
---
# Создание массива
# Array operations.
Задача из 5 шагов-строк:
Let's try 5 array operations.
1. Создайте массив `styles` с элементами "Джаз", "Блюз".
2. Добавьте в конец значение "Рок-н-Ролл"
3. Замените предпоследнее значение с конца на "Классика". Код замены предпоследнего значения должен работать для массивов любой длины.
4. Удалите первое значение массива и выведите его `alert`.
5. Добавьте в начало значения "Рэп" и "Регги".
1. Create an array `styles` with items "Jazz" and "Blues".
2. Append "Rock-n-Roll" to the end.
3. Replace the value in the middle by "Classics". Your code for finding the middle value should work for any arrays with odd length.
4. Strip off the first value of the array and show it.
5. Prepend `Rap` and `Reggie` to the array.
Массив в результате каждого шага:
The array in the process:
```js no-beautify
Джаз, Блюз
Джаз, Блюз, Рок-н-Ролл
Джаз, Классика, Рок-н-Ролл
Классика, Рок-н-Ролл
Рэп, Регги, Классика, Рок-н-Ролл
Jazz, Blues
Jazz, Bues, Rock-n-Roll
Jazz, Classics, Rock-n-Roll
Classics, Rock-n-Roll
Rap, Reggie, Classics, Rock-n-Roll
```