I have two JavaScript arrays, one current and one new. I can append new elements of Strings from the new array into the current array, and ONLY new elements.
For example, if I have two arrays currentArray = [a,d] and newArray = [a,b,c,d,e], we can see that elements b,c, and e are different (and thus can be appended to currentArray).
My UI allows me to select only the new elements from the new array to append. But currently, it only appends to the current at the end of the array.
If I were to select element b, I want the current array to be currentArray = [a,b,d], not currentArray= [a,d,b].
If I were to select element b, and then c, the current array should be currentArray= [a,b,c,d]
How do I implement this logic?
a2a base array or something which is constant?