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....
🌐
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....
🌐
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....
🌐
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(); ...
🌐
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.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-remove-an-element-from-a-javascript-array-removing-a-specific-item-in-js
How to Remove an Element from a JavaScript Array – Removing a Specific Item in JS
August 31, 2022 - The pop method also returns the removed element. The shift method can be used on an array to remove the first element of an array.