Created
September 6, 2019 19:18
-
-
Save masautt/9caca1bb263eac04e77907a0c4e92a63 to your computer and use it in GitHub Desktop.
How to remove the first element from an array in JavaScript?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let arr = ["M", "A", "S", "A", "U", "T", "T"] | |
//Remove the first element | |
arr.shift(); // returns "M" | |
console.log(arr) // --> [ 'A', 'S', 'A', 'U', 'T', 'T' ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment