DEV Community

はるはる Haruharu
はるはる Haruharu

Posted on

Introducing the Random Number Generator Function Maker for JavaScript!

Coding Made Easy: Introducing the Random Number Generator Function Maker for JavaScript!

Overview

You can use it here!

https://randommathjavascript.calc.haruharutv.jp/

Technologies Used

* HTML
* CSS
* JAVASCRIPT
Enter fullscreen mode Exit fullscreen mode
  • Image of the screen image.png

How to Use

It's very simple. Just open the site, enter the minimum and maximum values, and press the generate button to easily create a random number!

slide1.PNG

You can reference this code in the same way you would use a variable to generate a random number within the specified range!

Try It Out

Let's do a quick experiment using the code we mentioned earlier to write some JavaScript.

Your one-time code is <strong id="random"></strong>
<script>
document.getElementById("random").innerHTML=Math.floor(Math.random() * (9999 - 1000 + 1)) + 1000;
</script>
Enter fullscreen mode Exit fullscreen mode

スライド

You can see that it works well when you run the code like this.

Please bookmark it and use it anytime!

We support engineers every day!

If you find this helpful, please give it a like!

While UUIDs are generally used for management, if you need to use random numbers, please give it a try! It's easy with just a single line of code! (Although UUIDs can also be easily generated in languages like GAS or server-side languages)

Top comments (1)