Class Type Array Javascript Iterations Math