3 ms·
Math.random() generates a decimal that can be 0 but is less than 1, so when multiplied by 6 the range is 0-5.99999, which is then rounded down.
by nassimm 4y ago
Math.random() generates a decimal that can be 0 but is less than 1, so when multiplied by 6 the range is 0-5.99999, which is then rounded down.