Java Input Array String Functions Javascript