Flatten nested JSON to array of unique objects without indexes
I have this simple nested object which I need to flatten to be able to insert it into my database. const input = { name: "Benny", department: { section: "Technical", branch: { timezone: "UTC", }, }, company: [ { name:…