Returns a copy of the collection with the value at key set to the provided value.
A functional alternative to collection.set(key, value)
which will also work with plain Objects and Arrays as an alternative for collectionCopy[key] = value
.
set(collection: C, key, value): C;