scenario is that the user can choose as many times as he or she wants on the add contact page (return to the form page and enter the contact page again), so duplicate data will be generated.
has two arrays to store data. Arr1 sends an array of user identities to the server. Arr2 displays the user"s name on the page.
arr2 cannot be duplicated alone, because there may be duplicate names.
my idea is to de-weight the arr1 array while removing the weight of the arr2 through index.
but don"t know how to write the specific code? I wonder if there is a better way?
arr1userid
["id1","id2","id2","id4"]
arr2,userid
["","","",""]