0

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.

0

1 Answer 1

0

Would something like the below work?

_.each($testArray, function ($item1){

    var flag = false;
    _.each($setArray, function ($item2){
          if($item1 == $item2)
            flag = true;
    });

    if(flag == false)
        $setArray.push(item1);

});
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.