Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
November 30, 2020 03:49 pm GMT

Lots of Ways to Use Math.random() in JavaScript

Math.random() is an API in JavaScript. It is a function that gives you a random number. The number returned will be between 0 (inclusive, as in, its possible for an actual 0 to be returned) and 1 (exclusive, as in, its not possible for an actual 1 to be returned).

Math.random(); // returns a random number lower than 1

This is incredibly useful for gaming, animations, randomized data, generative art, random text generation, and more! It can be used for … Read article “Lots of Ways to Use Math.random() in JavaScript”


The post Lots of Ways to Use Math.random() in JavaScript appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.


Original Link: https://css-tricks.com/lots-of-ways-to-use-math-random-in-javascript/

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks