Write a javascript function that takes in two number arrays as arguments and then returns true if both arrays contain the same elements (order does not matter). You can assume that the arrays always have the same number of elements.

Examples:

equalArrays([5],[5])         // true
equalArrays([2,3],[0,7])     // false
equalArrays([4,1],[4,1])     // true
equalArrays([85,37],[37,85]) // true

Answer:

function equalArrays(a1, a2) {
   // return true if both arrays contain the same elements

}