shift string javascript code example
Example 1: javascript remove first item from array
var colors = ["red", "green", "blue"];
var red=colors.shift();
//colors is now ["green","blue"];
Example 2: js string slicing
const str = 'The quick brown fox jumps over the lazy dog.';
console.log(str.slice(31));
// expected output: "the lazy dog."
console.log(str.slice(4, 19));
// expected output: "quick brown fox"