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.

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct