Gm5,
<script>
function Freindly(min, max) {
const obj = {};
for (let i = min; i <= max; i++) {
obj[i] = getSum(i);
}
return Object.entries(obj)
.filter(([a, b], i) => obj[b] && obj[b] == a && a != b )
.filter((_, i) => i % 2 === 0)
.map(([a, b]) => [+a, b]);
}
function getSum(num) {
let end = num/2,
sum = 0;
for (let i = 1; i <= end; i++) {
if (num % i === 0) sum += i;
}
return sum;
}
let x = Freindly(1, 9000);
document.write(JSON.stringify(x))
</script>