To be fair, JSON.parse will clobber any duplicate keys before you get to that point.
You shouldn't need to go through a Map -- JS Objects operate similarly to Maps (that's what we did 10 years ago, before ES2015 brought Map to the language).
As MCroft mentions, I'd suggest doing some...