update()

Returns a copy of the collection with the value at key set to the result of providing the existing value to the updating function.

A functional alternative to collection.update(key, fn) which will also work with plain Objects and Arrays as an alternative for collectionCopy[key] = fn(collection[key]).

Method signature

update(collection: C, key, updater): C;
;