Suppose I have an object as,
const emailCount = {'vik@g.com':4,'sri@y.com':9}
And I have an array of object as,
const emailDetails = [{'emailId': 'vik@g.com','name':'Alision', 'subject':'hello'},{'emailId':'sri@y.com','name':'Hanumant', 'subject':'ola'},
{'emailId':'ally@o.com','name':'Brian', 'subject':'namaste'},{'emailId':'vik@g.com','name':'Alision', 'subject':'hello'}]
There can be multiple entries with same emailId.
So what I want to do is replace key i.e. emailId from emailCount with name from emailDetails.
Name for emailId in emailDetails, irrespective of how many entries will always remain same.
My expected O/P is : {'Alision':4,'Hanumant': 9}
How can I replace my key in emailCount with name in emailDetails' emailId as key?I tried looking solutions but was unable to find aything replated to it. If any one needs any furteher detais please let me.