remove first child js code example
Example 1: js remove first item
let myArray = [1, 2, 3, 4, 5];
let removedElement = myArray.shift();
Example 2: remove parent element javascript
node.parentNode.parentNode.removeChild(node.parentNode)
let myArray = [1, 2, 3, 4, 5];
let removedElement = myArray.shift();
node.parentNode.parentNode.removeChild(node.parentNode)