Check If String Is Numeric Javascript For Loop