I have an array of strings array1 , and array2 to compare. How to check for the occurrence of all elements in strict accordance and create a new array. I understand that in my case it is necessary to apply filter + includes. I have seen the answer for string.
An example of what is required in my case and the expected result:
array1 [ 'apple_mango_banana', 'mango_apple_banana', 'apple_banana' ]
array2 [ 'apple', 'mango' ]
result ['apple_mango_banana', 'mango_apple_banana' ]