1array.pop(); //returns popped element
2//example
3var fruits = ["Banana", "Orange", "Apple", "Mango"];
4fruits.pop(); // fruits= ["Banana", "Orange", "Apple"];
1
2const fruits = ["Banana", "Orange", "Apple", "Mango"];
3
4fruits.pop(); // Removes "Mango"
5
1// example (remove the last element in the array)
2let yourArray = ["aaa", "bbb", "ccc", "ddd"];
3yourArray.pop(); // yourArray = ["aaa", "bbb", "ccc"]
4
5// syntax:
6// <array-name>.pop();
1var fruits = ["Banana", "Orange", "Apple", "Mango"];
2document.write(fruits);
3document.write("<br>");
4fruits.pop();
5
6document.write(fruits)