0

I am new to JS. How to loop through an object and combine the value array

{
"key1":[val1, val2, val3],
"key2":[val3,val4,val5]
}

expected op - [val1,val2,val3,val4,val5] - no duplicates

  • 1
    This should help : https://stackoverflow.com/questions/1584370/how-to-merge-two-arrays-in-javascript-and-de-duplicate-items and to get the array from your object it's just `object.key1` or `object["key1"]` – Marius ROBERT May 12 '22 at 08:21

0 Answers0