How to remove the first element of an array in Javascript?

Asked

Viewed 70 times

-3

I would like to know how to remove the first element of an array.

//Array atual:
[1, 2, 3, 4, 5]

//Como quero que fique:
[2, 3, 4, 5]

  • 1

    Try to use array.shift(). This will remove the first element.

1 answer

2

Browser other questions tagged

You are not signed in. Login or sign up in order to post.