JavaScript Math_random Guide
Math.random() generates pseudo-random numbers. Combined with Math.floor for integers and custom ranges. The guide walks through Random Numbers. `Math.random()` — 0 to <1 (not cryptographically secure). Integer 0 to N-1: `Math.floor(Math.random() * N)`. Integer min to max: `Math.floor(Math.random() * (max - min + 1)) + min`. Random array element: `arr[Math.floor(Math.random() * arr.length)]`. `crypto.getRandomValues()` for secure randomness. The guide is organized into 1 sections that build on each other, each pairing a prose explanation with runnable code. Related guides: Arrays, Strings, Numbers, Math, Date. This is one of 145 JavaScript guides on JS Reference — see the full list on the guides page. Practice what you learn in the JavaScript playground, and look up any unfamiliar term in the JavaScript glossary.