Skip to content

Instantly share code, notes, and snippets.

@vlad-bezden
Created March 17, 2017 19:18
Show Gist options
  • Save vlad-bezden/c86273481fb09ef7736cb11f7171e4ce to your computer and use it in GitHub Desktop.
Save vlad-bezden/c86273481fb09ef7736cb11f7171e4ce to your computer and use it in GitHub Desktop.
Last element of the array
const x = [1, 2, 3, 4, 5]
const [last] = [...x].reverse()
console.log(`last: ${last}, x: ${x}`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment