Imagine having these two arrays:
var a = [126, 619, 4192, 753, 901];
var b = [413, 628, 131, 3563, 19];
Is there a way to identify elements in both arrays that are close to each other by a certain percentage? Let's say we have the following function,
function findCloseElements(array1, array2, percentage)
where
findCloseElements(a, b, 5);
would result in
[126, 131], [619, 628]