That does indeed look like a good solution if you know the object props.
But JSON.parse( JSON.stringify( obj ) );, though hacky, is much quicker to write!
JSON.parse( JSON.stringify( obj ) );
Oh okay. I misunderstood, I thought you were avoiding using that JSON.parse( JSON.stringify( obj ) ); for some reason. Whoops!
Have a good Turkey day, or a good Thursday.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
That does indeed look like a good solution if you know the object props.
But
JSON.parse( JSON.stringify( obj ) );
, though hacky, is much quicker to write!Oh okay. I misunderstood, I thought you were avoiding using that
JSON.parse( JSON.stringify( obj ) );
for some reason. Whoops!Have a good Turkey day, or a good Thursday.