
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
array.pop() – Removes the **last element** from an array and returns that element.
element = array.pop();
const arr=[1,2]; arr.pop(); // 2
Comments
Post a Comment