JavaScript slice vs splice vs split: Differences, Which One Changes the Array, toSpliced() and Common Mistakes (Tested Examples)
slice() copies part of an array or string without changing it, splice() removes, inserts or replaces items and changes the original array, and split() turns a string into an array. Here is how each one works, with real Node output, toSpliced() and the mistakes that cause bugs.