Appending with and without the option to replace repeated values [closed]

1 week ago 8
ARTICLE AD BOX

I've seen so many libraries that contain JSON appending but they don't really satisfy my needs. What I need is something like:

foo = { color: red, size: 16, } bar = { shape: triangle, size: 30 }

What I want to do is if the prop doesn't exist append it to foo, but if it does exist to have an option to replace the value or don't do anything.

Read Entire Article