JavaScript shift

JavaScript shift


JavaScript Array shift() 
In this Tutorial, we will learn about JavaScript Array shift() method with the help of following below:
The shift() Method removes the first element from an array and returns that removed element.
Syntax
array.shift()
Example1- Delete first element in Array Fruits With the help of shift() method:
Output
Note- The removed element from the array ; Array is empty returns undefined