Answers for "8.3.1. Common Array Methods // pop Examples (.pop)"

0

8.3.1. Common Array Methods // pop Examples (.pop)

//The general syntax for this method is:
arrayName.pop()

//This method removes and returns the LAST element in an array.
//No arguments are placed inside the parentheses ().

let arr = ['a', 'b', 'c', 'd', 'e'];

arr.pop();

console.log(arr);

//e
//['a', 'b', 'c', 'd']
Posted by: Guest on June-14-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language