Link Details

Link 15198 thumbnail
User 209881 avatar

By pcx99
via hunlock.com
Published: Mar 05 2007 / 12:47

Javascript frameworks have exploded on the scene over the last few years but they're no replacement for a good toolbox: those little snippets of code you seem to include in every single project. Here's my list of 10 essential Javascript tools everyone should have at their fingertips!
  • 22
  • 0
  • 2209
  • 1040

Comments

Add your comment
User 201715 avatar

boo_radley replied ago:

3 votes Vote down Vote up Reply

#2 on his list has a big flaw: his unformatnumber doesn't handle negative numbers...

>>> num = -4
-4
>>> num.toString().replace(/([^0-9\.])/g,'')*1;
4

User 209881 avatar

pcx99 replied ago:

1 votes Vote down Vote up Reply

You know, with my budget the way it is I really should have caught that ;) Fixed! Nice catch :) The un/format functions also blow up on exponents but that's a bit out of the scope of a simple commafier.

User 201715 avatar

boo_radley replied ago:

1 votes Vote down Vote up Reply

I thought about that too, but you're never going to see commas in scientific notation, so you get a free pass there :o)

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.