slice(start, end) returns a new array (end not included). [...arr] also makes a shallow copy. Editing the copy should leave the original list alone.

Original


        

Result / copy


        

Try a slice or a copy-then-edit.

Important JavaScript

const names = ["Ava", "Ben", "Cara", "Drew"];

const page = names.slice(1, 3);
// ["Ben", "Cara"] — original unchanged

const copy = [...names];
copy[0] = "Alex";
// names still starts with "Ava"
// copy starts with "Alex"

// Shallow copy: nested objects inside are still shared references.