check if string is interpretable as int


    Nov 21 2006 | 10:16 pm
    Hi,
    This might be a very basic question: is there a way in javascript to determine whether a string is interpretable as an int?
    In java there is Integer.parseInt(String). Is there something similar in javascript? I didn't find it in docs so far.
    Cheers,
    Mattijs

    • Nov 21 2006 | 10:30 pm
      Ok, sorry. Found it. I was confused because parseInt gave a strange output when posted, "1#R" if not cast to string. And I found the isNaN method :)
      Thanks,
      Mattijs