I need to do an union on an array like the UNION sql statement.
my original array :
const prices = [
{name:'product_name1', price_a:1.0, price_b:null, price_c:null},
{name:'product_name1', price_a:null, price_b:2.0, price_c:3.0},
{name:'product_name2', price_a:2.0, price_b:null, price_c:null},
{name:'product_name2', price_a:null, price_b:null, price_c:1.0},
]
my wanted array :
const prices = [
{name:'product_name1', price_a:1.0, price_b:2.0, price_c:3.0},
{name:'product_name2', price_a:2.0, price_b:null, price_c:1.0},
]
Any idea how to do this ?