Sign in
Log inSign up

What is the best way to mutate an object?

Ashish Kumar's photo
Ashish Kumar
·Feb 20, 2018

For example: If I have something like user.email = email || user.email

I have to update the email property of user if email exists, otherwise leave it untouched.