- slice
- splice
Array slice (range) or splice
slice(from, to) - shallow copy of a range defined by its end points.
splice(from, length) - shallow copy of a range defined by the number of elements in it
examples/arrays/slice.js
"use strict"; var names = ['Foo', 'Bar', 'Morse', 'Luke', 'Lea', 'Han Solo']; console.log(names.slice(3, 5)); // [ 'Luke', 'Lea'] console.log(names.splice(2, 3)); // ['Morse', 'Luke', 'Lea']