Say I have two arrays:
arr1 = ['One','Two','Four'];
arr2 = ['One','Two','Three','Five'];
What I am trying to do is compare the 2 arrays, and if arr1 contains a value that doesn't exist in arr2, then delete it from arr1
Based on above, I would expect arr1 to look like this:
arr1 = ['One','Two'];
I know there are similar examples online but the answers I'm finding are 5+ years old, using various approaches and I'm just trying to find a quick and effective and "modern" way to achieve this.
ANy pointers. THank you.