JavaScript array.pop() Function

JavaScript Logo

array.pop() – Removes the **last element** from an array and returns that element.

๐Ÿ‘‰ Syntax

element = array.pop();

๐Ÿงช Example

const arr=[1,2]; arr.pop(); // 2

Comments