Create a function that takes two parameters:
The function should return only the items from the first array that satisfies the anonymous function present in the second array.
#filterArray([1, 2, 3, 4], [100, (num) => num % 2 === 0]) ➞ [2, 4]
# 2 and 4 from [1, 2, 3, 4] satisifies anonymous function in the second array.
# (num) => num % 2 === 0 2 % 2 === 0 and 4 % 2 === 0
# 1 and 3 do not satisfy (num) => num % 2 === 0
filterArray([1, 2, 3, 4], [1, 2, (num) => num % 2 === 0]) ➞ [2 , 4]
filterArray([1, 2, 3, 4, 5], [1, 2, (num) => num % 2 === 1,"eon","epoch"]) ➞ [1, 3, 5]
filterArray(["apple", "kiwi"], [2, (txt) => txt.indexOf("a") > -1]) ➞ ["apple"]