I'm curious if there is a good way to find the first occurrence of element from array in another array. As result, the answer should be a null (if no elements from the first array in the second array) or this element. Ex.1:
fromArr = ["Yellow", "Green", "Orange", "Apple", "Banana", "Apple"];
whereArr= ["Apple", "Orange", "Banana", "Apple"];
//the answer should be "Orange", as the order counts (first we check for "Yellow", then for "Green", then for "Orange" - occurrence found!).
Ex.2:
fromArr = ["Orange", "Apple", "Banana", "Apple"];
whereArr= ["November", "December", "April", "Banana"];
//the answer should be "Banana".
Ex.3:
fromArr = ["Orange", "Apple"];
whereArr= ["November", "December", "April"];
//the answer should be null.
Thank you