Created
September 6, 2019 19:20
-
-
Save masautt/298a6fefb1d8bbec65698db879e4c765 to your computer and use it in GitHub Desktop.
How to remove the last element from an array?
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 last element | |
arr.pop(); // returns "T" | |
console.log(arr) // --> [ 'M', A', 'S', 'A', 'U', 'T' ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment