A step-by-step tutorial on how to use shift() and unshift() in JavaScript. The shift() method removes the first element of an array and the return value is the removed element. The unshift() method adds a specified element or elements to the beginning of an array and the return value is the new length of the array.