minor fixes

This commit is contained in:
Ilya Kantor 2020-09-24 17:07:39 +03:00
parent 58ed032bf8
commit b18b5ba761

View file

@ -36,15 +36,15 @@ That's natural, because `delete obj.key` removes a value by the `key`. It's all
So, special methods should be used. So, special methods should be used.
The [arr.splice(start)](mdn:js/Array/splice) method is a swiss army knife for arrays. It can do everything: insert, remove and replace elements. The [arr.splice](mdn:js/Array/splice) method is a swiss army knife for arrays. It can do everything: insert, remove and replace elements.
The syntax is: The syntax is:
```js ```js
arr.splice(index[, deleteCount, elem1, ..., elemN]) arr.splice(start[, deleteCount, elem1, ..., elemN])
``` ```
It starts from the position `index`: removes `deleteCount` elements and then inserts `elem1, ..., elemN` at their place. Returns the array of removed elements. It modified `arr` starting from the index `start`: removes `deleteCount` elements and then inserts `elem1, ..., elemN` at their place. Returns the array of removed elements.
This method is easy to grasp by examples. This method is easy to grasp by examples.