Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • @ElliotBonneville I didn't proof it. Am I wrong? I'll delete if so. Commented Apr 22, 2012 at 5:01
  • No, it's right. Just... there are simpler methods of doing this. =) I generally like to avoid RegEx unless I really need it. Commented Apr 22, 2012 at 5:02
  • @ElliotBonneville Hmm... this one seems pretty simple to me, but I'm genuinely interested in why you think it's not. Is it inefficient? Commented Apr 22, 2012 at 5:03
  • I don't have any sources that say it's less efficient than isNan(Number(myStr));, but I have a hunch using RegEx will be slower. Plus, I'm biased against RegEx, so that factored into my comment as well. Commented Apr 22, 2012 at 5:08
  • Understood. I'm happy to take note (and get better) when I do things wrong. But thanks for not down voting a correct answer! Commented Apr 22, 2012 at 5:09