How to Generate 10 Digit Unique Number in JavaScript?

Hello friends, today I will tell you through this article how you can generate unique number of 10 digite through javascript code. So let’s go.

Through javascript code you can generate random number very easily. This is because javascript gives some inbuilt function that can be used to work in javascript only by the same function. As if you assume in javascript To generate a random number of 10 digits. So there is a random function in JavaScript. Which only generates integer random number. You can generate unique number of 10 digit with the help of this function.

How this function will be used. So let’s go.

Example:-

<p id="tendigit"></p>
<script>
var tendigitrandomnumber = Math.floor(1000000000 + Math.random() * 9000000000);
document.getElementById("tendigit").innerHTML=tendigitrandomnumber;
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *