Javascript For Loop With Array Length