Returns a pseudorandom number between 0 and 1.
Math.random(); // 0.6236026335973293 Math.random(); // 0.10149288410320878 Math.random(); // 0.6313296002335846
Due to the nature of the generation methods, these pseudo-random numbers are not uniformly distributed. They are normally distributed which means that, in general, a number is more likely to be closer to 0.5 than 0 or 1.
Note that this method is unsuitable for cryptography. The WebCrypto API addresses this.