I have two arrays as shown below:
['TAG.u', 'TAG.c']
and the other one is:
[{name:'some',key:'TAG.u'},
{name:'some new', key: 'TAG.b'},
{name:'some another' , key:'TAG.c'},
{name: 'some big' , key:'TAG.a'}]
Now I want to combine these two arrays into a new array with a new property selected: true
for each matching key and false for others, like this:
result: [{name:'some', key: 'TAG.U', selected: true} ,
{name:'some another' , key:'TAG.c' , selcted: true},
{name:'some new', key: 'TAG.b', selected: false},
{name: 'some big' , key:'TAG.a' , selected: false} ]
Thank you for any assistance.