splice method in array example fix

pull/27/head
Patrick Njuguna 5 years ago committed by GitHub
parent dd35bb6b1c
commit 4790a2317e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -503,7 +503,7 @@ Splice: It takes three parameters:Starting position, number of times to be remov
```js
const numbers = [1, 2, 3, 4, 5];
console.log(numbers.splice() // -> remove all items
console.log(numbers.splice()) // -> remove all items
console.log(numbers.splice(0,1)) // remove the first item
console.log(numbers.splice(3, 3, 6, 7, 8)) // -> [1,2,6,7,8] //it removes two item and replace three items

Loading…
Cancel
Save