Say I have an object: {a: 'A', b: 'B', c: 'C'}
and I want to create a new object from it that would have the same values except I want to set c: 'D'
.
What is the syntax for that? I tried something like:
{c: 'D', ...rest} = {...foo}
But it is not a valid syntax.