Is there anything i can use that is like apply but...
# stdlib
a
Is there anything i can use that is like apply but doesn’t mutate the original object and instead returns a copy?
r
Not really, as there isn't a universal idea of "copy".
☝️ 1
m
Only if it's a data class. Then you have the copy function and can used named parameters syntax to replace values in the copy.
r
Even then the signature isn't universal.