Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lpf23/9762508 to your computer and use it in GitHub Desktop.
Save lpf23/9762508 to your computer and use it in GitHub Desktop.
10 Digit Random Number Generator - JavaScript
var digits = Math.floor(Math.random() * 9000000000) + 1000000000;
@Ambroza888
Copy link

Thank you, you are great !

@aria-dev
Copy link

Thanks! Worked perfectly!

@Shaanfatima
Copy link

Please can you let me know want can be the html file for this?

@nielvid
Copy link

nielvid commented May 5, 2021

Well done, it could have also been
const digits = Math.floor(Math.random() * 9000000000) + 1;

@Oyshoboy
Copy link

One more solution:
parseInt(Math.random().toFixed(10).replace("0.",""))

@ilKhr
Copy link

ilKhr commented Oct 9, 2022

Much thanks

@andrewfwamba
Copy link

Very Nice

@ngangavic
Copy link

Very helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment