📌 Roll the Fun: Building an Interactive Dice with TailwindCSS and ReactJS
Up until now, whenever I had to create a dice roll, I’d just reach for Math.random() multiply it by 6, add 1, and wrap it in Math.floor() to get a whole number between 1 and 6. Simple and done.Something like this:
â›¶const rollDice = () => Math.floor(Math.random() * 6) + 1;Functional Yes,
Exci...
🔗 Подробнее: https://www.roastdev.com/p...
Up until now, whenever I had to create a dice roll, I’d just reach for Math.random() multiply it by 6, add 1, and wrap it in Math.floor() to get a whole number between 1 and 6. Simple and done.Something like this:
â›¶const rollDice = () => Math.floor(Math.random() * 6) + 1;Functional Yes,
Exci...
🔗 Подробнее: https://www.roastdev.com/p...
Roll the Fun: Building an Interactive Dice with TailwindCSS and ReactJS
Up until now, whenever I had to create a dice roll, I’d just reach for Math.random() multiply it by 6, add 1, and wrap it in Math.floor() to get a whole number between 1 and 6. Simple and done.Somet...
https://www.roastdev.com/post/roll-the-fun-building-an-interactive-dice-with-tailwindcss-and-reactjs
25 days ago