Use a combination of Math.floor() and Math.random().
This simple one line of code will return you a number between 1 and 6 (both included):
Math.floor(Math.random() * 6 + 1)
There are 6 possible outcomes here: 1, 2, 3, 4, 5, 6.
| 1: | Fundamentals |
| 2: | HTML and CSS |
| 3: | Tools |
| 4: | Deployment |
| 5: | JavaScript |
| 6: | More JavaScript |
| 7: | TypeScript |
| 8: | Python |
| 9: | More Python |
| 10: | PHP |
| 11: | More CSS |
| 12: | DOM and Events |
| 13: | Networking |
| 14: | Browser API |
| 15: | Server Runtimes |
| 16: | HTTP Servers |
| 17: | Forms |
| 18: | Databases |
| 19: | Libraries and frameworks |
| 20: | Docker |
| 21: | Go |
| 22: | C |
| 23: | Linux |
| 24: | Swift |
| 25: | Electronics |
| 26: | Misc |
Use a combination of Math.floor() and Math.random().
This simple one line of code will return you a number between 1 and 6 (both included):
Math.floor(Math.random() * 6 + 1)
There are 6 possible outcomes here: 1, 2, 3, 4, 5, 6.
Want to master TypeScript? Check out my TypeScript Masterclass
Join my AI Workshop !
The Web Development BOOTCAMP cohort starts in February 2026