remove the first element and add a new one in js code example
Example: js remove first item
let myArray = [1, 2, 3, 4, 5];
let removedElement = myArray.shift();
let myArray = [1, 2, 3, 4, 5];
let removedElement = myArray.shift();