I have an object as below,
name_details = { 'Quantity based detail': 'X13', 'Comms+excess': 'X14' , 'normal_detail': 'X15', 'Flat_detail': 'X16', 'Quantity based detail': 'X17'}
I want the output to be as below
name_details = { 'Quantity based detail': 'X13', 'QBD:' 'Comms+excess': 'X14' , 'normal_detail': 'X15', 'Flat_detail': 'X16'}
Where ever the key is same, delete the later entry from the object to have only unique keys in the object.
I know a short way to do this for an array as below, but not sure for an object
var new_array = [...new Set(old_array)];
Please help how can I achieve this with less lines of code for the object.
Thank you