A JavaScript cheat sheet
1. slice() The splice() method adds/removes items to/from an array, and returns the removed item(s). Output: Note that on using splice() the original array is impacted. The contents of the original array can be modified by adding or removing elements too, such as in the following example. Remove the word ‘the’ from the selected index …