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// 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();
1array.pop(); //returns popped element
2//example
3var fruits = ["Banana", "Orange", "Apple", "Mango"];
4fruits.pop();