faqts : Computers : Programming : Languages : JavaScript : Language Core : Numbers

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

20 of 34 people (59%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

How do I generate a unique number?

Mar 31st, 2000 11:20
Martin Honnen,


Client side you get a unique number if you take the actual Date's time 
in milliseconds i.e.
  var number = new Date().getTime();
Note however if you submit this time to a server side application that 
there are (low) chances that two different clients submit the same 
number.