Skip to content

Instantly share code, notes, and snippets.

@masautt
Created September 6, 2019 19:20
Show Gist options
  • Save masautt/298a6fefb1d8bbec65698db879e4c765 to your computer and use it in GitHub Desktop.
Save masautt/298a6fefb1d8bbec65698db879e4c765 to your computer and use it in GitHub Desktop.
How to remove the last element from an array?
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