Skip to content

Instantly share code, notes, and snippets.

@marshallmurphy
Created June 5, 2020 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marshallmurphy/5719f8ebe685df68e1e6b61351011c3a to your computer and use it in GitHub Desktop.
Save marshallmurphy/5719f8ebe685df68e1e6b61351011c3a to your computer and use it in GitHub Desktop.
let array = ['a', 'b', 'c', 'd', 'e']
array.slice(2)
// returns ['a', 'b', 'c'] and original array is unchanged
// array = ['a', 'b', 'c', 'd', 'e']
array.splice(0, 2)
// permanently changes the original array
// array = ['c', 'd', 'e']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment