Yeah this question is confusing without more context, because that is already how JavaScript objects work by default. If you assign multiple times to one key, only the latest assignment is preserved. It’s more complicated (though not much more) to merge two JavaScript objects while preserving duplicates.
It would be difficult to search because that is a weird question. If you asked a more practical question like "merge two arrays and remove duplicate values" you would find tons of exact results.
(This is a genuine question) Is it hard to find a solution to that question on the web by using a search engine?