The shift()
method removes the first element from an array and returns that removed element. This method changes the length of the array.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Document Tags and Contributors
Tags:
Contributors to this page:
chrisdavidmills,
nareshp1996,
thwee-alchemist,
diablero13,
wbamberg,
ChuyingHe,
AndrzejSala,
JaxCavalera,
fscholz,
erikadoyle,
jeremy-putt,
uxitten,
oksana-khristenko,
bakotaco,
David_Gilbertson,
eduardoboucas,
Mingun,
denim2x,
binki,
nquinlan,
Sheppy,
ethertank,
evilpie,
Skalman,
Sevenspade,
Mgjbot,
Waldo,
Yuichirou,
Maian,
Dria
Last updated by:
chrisdavidmills,