[Javascript] Array.prototype.with Immutable replace element inside array
Intro to Array.prototype.with(index, value)
const ages = [10, 15, 20, 25];
const newAges = ages.with(1, 16);
console.log(newAges); // [10, 16, 20, 25]
console.log(ages); // [10, 15, 20, 25] (unchanged)