$('.openAnswers').click(function() {
$(this).closest('.parent_class').find('.comReplies').slideToggle();
});
const a = [
{
VendorCode: 'kek',
Color: 'Черный',
Size: '35'
},
{
VendorCode: 'kek',
Color: 'Черный',
Size: '36'
},
{
VendorCode: 'kek',
Color: 'Белый',
Size: '35'
}
]
const b = [
{
Name: 'Белый',
Hex: '#FFF'
},
{
Name: 'Черный',
Hex: '#000'
}
]
function unique(arr) {
let res = [];
for (let el of arr) {
if (!res.find(rl => rl.Color === el.Color)) {
res.push(el);
}
}
return res;
}
const c = unique(a).map(el => b.find(elb => elb.Name === el.Color)?.Hex)