When working with Next.js, I created a function component where I utilized the useState hook to declare a variable for storing an array of digits. Here is an example:
const [digits, setDigits] = useState<number[]>();
I desire to define the range of the array generically, similar to Array(3)
(not [number, number, number]
as it is too lengthy). How can this be achieved?