Home / Javascript Tips Generated By ChatGPT / Using Array.slice for Non-destructive Array Operations in Javascript Create a shallow copy of a portion of an array without modifying the original array. Source Code let numbers = [1, 2, 3, 4, 5]; let middle = numbers.slice(1, 4); console.log(middle); // [2, 3, 4]