I am looking for a way to rearrange array1 based on array2.
var array1 = ["cat","dog","mouse","elephant","ant","cow","goat","hen"];
var array2 = ["mouse","cow","goat"];
Expected output:
var another_array = ["mouse","cow","goat", "bird"--- then rest of the values in array1]