Merge pull request #2146 from Ruslan-Aleev/patch-1

Changed "position" to "index" for slice() method
This commit is contained in:
Ilya Kantor 2020-09-24 14:20:49 +03:00 committed by GitHub
commit 1f8b72be8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -712,7 +712,7 @@ A cheat sheet of array methods:
- `shift()` -- extracts an item from the beginning, - `shift()` -- extracts an item from the beginning,
- `unshift(...items)` -- adds items to the beginning. - `unshift(...items)` -- adds items to the beginning.
- `splice(pos, deleteCount, ...items)` -- at index `pos` delete `deleteCount` elements and insert `items`. - `splice(pos, deleteCount, ...items)` -- at index `pos` delete `deleteCount` elements and insert `items`.
- `slice(start, end)` -- creates a new array, copies elements from position `start` till `end` (not inclusive) into it. - `slice(start, end)` -- creates a new array, copies elements from index `start` till `end` (not inclusive) into it.
- `concat(...items)` -- returns a new array: copies all members of the current one and adds `items` to it. If any of `items` is an array, then its elements are taken. - `concat(...items)` -- returns a new array: copies all members of the current one and adds `items` to it. If any of `items` is an array, then its elements are taken.
- To search among elements: - To search among elements: