const names = ["Alex", "Sam", "Blane"]; const newNames = names.with(1, "Sammy"); // names remains unmodified console.log(newNames);
["Alex", "Sammy", "Blane"]