1function remove_last_child() {
2 var select = document.getElementById('parent_element');
3 select.removeChild(select.lastChild);
4}
1array.pop(); //returns popped element
2//example
3var fruits = ["Banana", "Orange", "Apple", "Mango"];
4fruits.pop(); // fruits= ["Banana", "Orange", "Apple"];
1array.pop();
2
3// Example
4var colors = ['Yellow', 'Red', 'Blue', 'Green'];
5var removedColor = colors.pop(); // Green
6console.log(colors); // ['Yellow', 'Red', 'Blue']
1
2const fruits = ["Banana", "Orange", "Apple", "Mango"];
3
4fruits.pop(); // Removes "Mango"
5