This commit is contained in:
Ilya Kantor 2017-05-10 16:44:54 +03:00
parent c56693bca8
commit f16b0cf21d

View file

@ -423,17 +423,18 @@ This works exactly the same as a longer function expression above.
### reverse ### reverse
The method [arr.reverse](mdn:js/Array/reverse) creates a new array with the reverse order. The method [arr.reverse](mdn:js/Array/reverse) reverses the order of elements in `arr`.
For instance: For instance:
```js run ```js run
let arr = [1, 2, 3, 4, 5]; let arr = [1, 2, 3, 4, 5];
arr.reverse();
alert( arr.reverse() ); // 5,4,3,2,1 alert( arr ); // 5,4,3,2,1
``` ```
The original array is not modified. It also returns the array `arr` after the reversal.
### split and join ### split and join