HERE IS THE FULL QUESTION DESCRIPTION
Given two arrays a and b write a function comp(a, b) (compSame(a, b) in Clojure) that checks whether the two array
The easiest possible way:
const comp = (a1, a2) => { if (!a1 || !a2 || a1.length !== a2.length) return false; return a1.map(x => x * x).sort().toString() === a2.sort().toString(); }