Javascript Average Array Reduce Method Js Compiler