Reduce Function Array Javascript Length Of Integer Javascript