Functional programming, particularly higher level functions, works heavily with lists of data
Functional programming requires pure functions, functions that do not cause side effects or modify their input data.
In this post we’ll master the slice method by example, exploring 8 different ways it can be used.
Caution: The slice method is not to be confused with the splice method, which modifies an array in place.
Slice leaves the original array intact and returns a shallow copy of selected items, splice modifies the original array.