Utilities Site – Randomness Generator

A very simple piece of functionality that we can add to a utilities site is a generator of something random. For these types of Applications there can be many variations and they are a great way of increasing the number tools available on your utilities site.

Examples of these could include generating a random number, generating a random color, generating a random name and many more. In this example we will take on the generation of a random number.

Using JavaScript we can achieve this almost immediately via the in built Math.Random() method which is able to generate random integers. To randomly generate a number of 0 to 100 we would use the following.

Math.floor(Math.random() * 101);

Leave a Reply