I am working with three arrays:
arr1=["14","16","1"]
— this is where I make my selectionarr2=["14"]
— this is where I compare my selection fromarr1
arr3=[]
— this array stores the values that meet the conditions
How can I check if the selected value does not exist in arr2
?
For instance, if I select 14 from arr1
and it already exists in arr2
, the button should be disabled and the value should not be added to arr3
.