splic js code example
Example 1: javascript explode
var str = "Well, how, are , we , doing, today";
var res = str.split(",");
Example 2: javascript turn string into array
var fruits = 'apple, orange, pear, banana, raspberry, peach';
var ar = fruits.split(', ');
console.log( ar );
Example 3: javascript splice
let arr = ['foo', 'bar', 10, 'qux'];
arr.splice(1, 1);
arr.splice(2, 1, 'tmp');
arr.splice(0, 1, 'x', 'y');
Example 4: Array#splice
let arrDeletedItems = array.splice(start[, deleteCount[, item1[, item2[, ...]]]])