const comp = (a, b) => {
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) { return false; }
return a.reduce((x, y) => x+y, 1) === b.reduce((x, y) => x + Math.sqrt(y), 1)
};
console.log(comp(
[121, 144, 19, 161, 19, 144, 19, 11],
[11*11, 121*121, 144*144, 19*19, 161*161, 19*19, 144*144, 19*19]
));
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.