Answers for "how to get random number in react"

1

react random number

function Random(props) {
        var maxNumber = 45;
        var randomNumber = Math.floor((Math.random() * maxNumber) + 1);
        return <div>{randomNumber}</div>;
      }
Posted by: Guest on June-18-2021

Code answers related to "how to get random number in react"

Code answers related to "Javascript"

Browse Popular Code Answers by Language