The easiest way is using shift(). If you have an array, the shift function shifts everything to the left.

var arr = [1, 2, 3, 4]; 
var theRemovedElement = arr.shift(); // theRemovedElement == 1
console.log(arr); // [2, 3, 4]
Answer from Thalsan on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ jsref_shift.asp
W3Schools.com
The shift() method changes the original array. The shift() method returns the shifted element. The Array unshift() Method ยท The Array push() Method ยท The Array pop() Method ยท array.shift() Array Tutorial ยท
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ Array โ€บ shift
Array.prototype.shift() - JavaScript | MDN
const array = [1, 2, 3]; const firstElement = array.shift(); console.log(array); // Expected output: Array [2, 3] console.log(firstElement); // Expected output: 1 ... The removed element from the array; undefined if the array is empty.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ Array โ€บ pop
Array.prototype.pop() - JavaScript | MDN
The removed element from the array; ... If you call pop() on an empty array, it returns undefined. Array.prototype.shift() has similar behavior to pop(), but applied to the first element in an array....
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ javascript โ€บ standard-library โ€บ Array โ€บ shift
JavaScript Array shift() - Remove First Element | Vultr Docs
November 25, 2024 - Explore practical examples that ... and your data processing logic. Start with a sample array. Apply the shift() method to remove the first element....
๐ŸŒ
CoreUI
coreui.io โ€บ answers โ€บ how-to-remove-the-first-item-from-an-array-in-javascript
How to remove the first item from an array in JavaScript ยท CoreUI
September 18, 2025 - As the creator of CoreUI, a widely ... beginning. From my expertise, the most efficient and built-in solution is using the shift() method, which removes and returns the first element....
๐ŸŒ
SheCodes
shecodes.io โ€บ athena โ€บ 37747-how-to-remove-the-first-element-of-an-array-in-javascript
[JavaScript] - How to remove the first element of an array in JavaScript
Learn how to remove the first element of an array in JavaScript using the shift() method. ... if I have a variable outside a function, do I need to redefine that variable inside the function? similarly, can use the same name for a variable if ...
Find elsewhere
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ javascript-delete-element-from-the-beginning-of-js-array
JavaScript - Delete Element from the Beginning of JS Array - GeeksforGeeks
July 23, 2025 - The splice() method is used to remove elements by specifying index and count. ... Array destructuring is used to extract the first element and create a new array with the rest elements.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ delete-the-first-element-of-array-without-using-shift-method-in-javascript
Delete the first element of array without using shift() method in JavaScript | GeeksforGeeks
July 22, 2024 - This approach directly modifies ... end of JavaScript arrays:1. Using pop() methodThe pop() method is used to remove the last element from an array and returns the modified array.JavaScriptlet a = [1, 2, 3, 4]; // Remove last ...
๐ŸŒ
YouTube
youtube.com โ€บ watch
JavaScript pop First Element - YouTube
JavaScript pop first element, this video shows how to do that by using two different methods. This video will show you how to do JavaScript pop from front.Se...
Published ย  May 19, 2025
๐ŸŒ
30 Seconds of Code
30secondsofcode.org โ€บ home โ€บ javascript โ€บ array โ€บ remove first or last n array elements
Remove the first or last n elements from a JavaScript array - 30 seconds of code
December 24, 2023 - Array.prototype.shift() and Array.prototype.pop() are the two mutative methods available for removing a single element from the beginning or end of an array, respectively. Both methods mutate the original array and return the removed element. ...
๐ŸŒ
Medium
medium.com โ€บ @gisorehaggai โ€บ difference-between-pop-delete-and-shift-in-js-2a5821e77316
Difference between pop(), delete and shift() in js | by Haggai Gisore | Medium
June 8, 2023 - The pop() method is used to remove the last element from an array and return that element. It modifies the original array by reducing its length by one. Here's an example: let fruits = ['apple', 'banana', 'orange']; let removedFruit = fruits.pop(); ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript-delete-element-from-the-beginning-of-js-array
JavaScript โ€“ Delete Element from the Beginning of JS Array | GeeksforGeeks
November 14, 2024 - JavaScript - Delete Elements from ... end of JavaScript arrays:1. Using pop() methodThe pop() method is used to remove the last element from an array and returns the modified array.JavaScriptlet a = [1, 2, 3, 4]; // Remove last ...
๐ŸŒ
Delft Stack
delftstack.com โ€บ home โ€บ howto โ€บ javascript โ€บ javascript remove first element from array
How to Remove First Element From an Array in JavaScript | Delft Stack
February 2, 2024 - In this article, we will see how to remove first element from the array using various method pre-build methods in JavaScript.