[Solved] find the average of both arrays, and then spit out the greater of the two
If you want to get the average of the elements in a and b, you need to be summing those elements, not the elements of first. Also, you had an extra ; after if (avg1 > avg2), which was creating an empty body for that conditional, so return “first” was being executed unconditionally. function compare(a,b) … Read more