.splice in jsscript code example
Example 1: splice javascritp
let colors = ['red', 'blue', 'green'];
let index_element_to_be_delete = colors.indexOf('green');
colors.splice(index_element_to_be_delete);
//Colors now: ['red', 'blue']
Example 2: splice javascript
let arrDeletedItems = arr.splice(start[, deleteCount[, item1[, item2[, ...]]]])