en.javascript.info/1-js/4-data-structures/7-array/3-create-array/task.md
2016-03-21 10:16:55 +03:00

24 lines
571 B
Markdown

importance: 5
---
# Array operations.
Let's try 5 array operations.
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
```