Add or replace an item in the given array, it returns a new array (immutable). Typescript wise this is meant to keep the same type on the newly returned array, therefore the newItem must match the type of the list items.
newItem
list
The original array to modify.
The item to add or replace.
Optional
The index at which to replace the item (if defined).
A new array with the item added or replaced.
Add or replace an item in the given array, it returns a new array (immutable). Typescript wise this is meant to keep the same type on the newly returned array, therefore the
newItemmust match the type of thelistitems.