How to append a smaller list of object in another main list after checking only those elements from the smaller list are getting appended which were not previously in main list. I have to do it in javascript.
_.each($testArray, function ($item1){
var flag = false;
_.each($setArray, function ($item2){
if($item1 == $item2)
flag = true;
});
if(flag == false)
$setArray.push(item1);
});