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']
view raw example.js hosted with ❤ by GitHub