Hello. I need your help here.. I have two arrays, like: array1: 1,2,3,4 and array2: 2,4 and I need to subtract values from the array1, that are present in the array2, so in the end i get array3: 1,3. I don't know the order of the values.. they can be like 5 3 1 2.. Any ideas or tips on how I can do this? Thank you
You need a nested for loop to compare the elements of the two arrays. When a match is found, use Array.splice to remove the matching elements. Simple.
u have to check the array values in a for loop and set the array value to NULL.. whereever same values are there..