- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandomNumbers.js
More file actions
Latest commit
7 lines (6 loc) · 469 Bytes
/
Copy pathrandomNumbers.js
File metadata and controls
7 lines (6 loc) · 469 Bytes
1
2
3
4
5
6
7
// The Math.floor() method rounds a number DOWNWARDS to the nearest integer, and returns the result.
// The Math.random() method returns a random number from 0 (inclusive) up to but not including 1 (exclusive).
console.log(Math.floor(Math.random()*10));// 0 - 9
console.log(Math.floor(Math.random()*100));// 0 - 99
console.log(Math.floor(Math.random()*1000));// 0 - 999
console.log(Math.floor(Math.random()*10000));// 0 - 9999